Running the hapi-fhirstarters-client-skeleton TestApplication?

47 views
Skip to first unread message

Carty Castaldi

unread,
Jan 4, 2022, 11:53:09 AM1/4/22
to HAPI FHIR
Hi Team,

I am new here, I am a reasonably experienced sw engineer but have never worked with java. I have a debian machine with maven. I am able to install and build jpaserver, it's very exciting.

I'd also like to run the fhirstarters client skeleton, I am having what I hope is a simple problem you can help with.

I git clone the repository, mvn package, the build seems to run OK, hapi-fhirstarters-client-skeleton-5.0.0.jar appears in /target

Screen Shot 2022-01-04 at 11.34.30 AM.png
How do I execute TestApplication?

In the .jar I see

1794 Tue Jan 04 15:54:02 UTC 2022 test/TestApplication.class5561 Tue Jan 04 15:54:02 UTC 2022 test/TestApplicationHints.class

but when I try:
java -jar hapi-fhirstarters-client-skeleton-5.0.0.jar

I get a message: -5.0.0.jar
no main manifest attribute, in hapi-fhirstarters-client-skeleton-5.0.0.jar

when I try:
java -cp hapi-fhirstarters-client-skeleton-5.0.0.jar test.TestApplication I see: 5.0.0.jar test.TestApplicationError: Unable to initialize main class test.TestApplicationCaused by: java.lang.NoClassDefFoundError: org/hl7/fhir/instance/model/api/IBaseResource

team I promise I will learn more about maven and java environment stuff but if I am doing something simple and stupid here I'd really appreciate the help.

-Carty

Mohamed Omar

unread,
Jan 4, 2022, 11:59:04 AM1/4/22
to Carty Castaldi, HAPI FHIR
Please list the Java versions that you are using in IDE and command line (Java/c --version etc..) most likely your are compiling with a version and executing with another.

-M

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/d15245bb-00a4-42d1-b62b-1a78a18f0614n%40googlegroups.com.

Carty Castaldi

unread,
Jan 4, 2022, 12:11:00 PM1/4/22
to HAPI FHIR
Thanks for your help!

$ java --version
openjdk 11.0.13 2021-10-19OpenJDK Runtime Environment (build 11.0.13+8-post-Debian-1deb10u1)OpenJDK 64-Bit Server VM (build 11.0.13+8-post-Debian-1deb10u1, mixed mode, sharing)

$ mvn -v Apache Maven 3.6.0 Maven home: /usr/share/mavenJava version: 11.0.13, vendor: Debian, runtime: /usr/lib/jvm/java-11-openjdk-amd64Default locale: en, platform encoding: UTF-8OS name: "linux", version: "4.19.0-17-cloud-amd64", arch: "amd64", family: "unix"

-C

Carty Castaldi

unread,
Jan 5, 2022, 11:31:16 AM1/5/22
to HAPI FHIR
OK the correct command for running the class is:

$ java -cp target/hapi-fhirstarters-client-skeleton-5.0.0.jar test.TestApplication
(I am having another issue will start note)
Reply all
Reply to author
Forward
0 new messages