Ruturaj Patil
Ruturaj Patil

Reputation: 608

Why javaFX application jar runs on jdk but not on jre?

I've my JavaFX app that calls some JNI code, uses a preloader jar and is compiled using jdk 1.7. Now when I run jar on another computer with JRE7, by:

  1. Double clicking jar: it starts but cannot load the JNI code containing libraries and therefore gets stuck.
  2. Running jar via terminal using "java -jar ": App runs completely normal!
  3. Now if I install jdk on this machine, it runs fine even with double click!

Can somebody tell me what is difference in these 3 cases?

Upvotes: 0

Views: 1225

Answers (2)

Kingand
Kingand

Reputation: 627

This may have something to do with the fact that JavaFX is not fully released with Java 1.7, but included more as a developer preview.

Also, JavaFX packaging and deployment is a little different than standard Java. There is a new utility called 'javafxpackager' that should be used when packaging JavaFX applications. Check out the documentation here: http://docs.oracle.com/javafx/2/deployment/jfxpub-deployment.htm

Upvotes: 0

Jesper Bangsholt
Jesper Bangsholt

Reputation: 534

Try to add logging to your program, so that you can figure out why your JAR file doesn't execute properly.

You should look into if your manifest file is correct - there is a classpath in there you might want to take a look at.

Upvotes: 1

Related Questions