3

I have created a JavaFx application using Netbeans. It is running fine, if I run the application from Netbeans.But, if I double click the jar file, I am getting error message as

JavaFx 2.1.0 is required to view this content but JavaFx. Get the JavaFx runtime from javafx.com/javafx and run the installer. Then restart the application

But I already have JavaFX runtime installed in my PC. But, if I run the jar file from command line as java -jar MyJavaFxApplication.jar, then it is running properly.

My question is somehow similar to the question "Unable to run JavaFx Jar with JRE7". But that question still unanswered.

My Java version is :

java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)

Thanks in advance.

Community
  • 1
  • 1
Dinesh
  • 16,014
  • 23
  • 80
  • 122
  • Please update your question to explain how you packaged your application and what the contents of the MANIFEST.MF file of the exploded jar are. – jewelsea Feb 15 '13 at 20:59
  • JavaFX was only included in the Oracle Java Runtime Environment as of Java 7 build 6 and you are using build 5, so update to a later version of the Java runtime and see if it works (following the instructions that your application provided you and that you replicated in your question). – jewelsea Feb 15 '13 at 21:03
  • Check if you have multiple versions of Java (or the JavaFX runtime) installed on your machine - if so perhaps a different version of Java is being invoked when you double click on your jar than what you expect. – jewelsea Feb 15 '13 at 21:06
  • Running Windows? Sounds like the double click is not running the expected version of java. Check your environment path for java, your installed version(s) of java (JRE and JDK), and the association of .jar files with a Windows application. [link](http://stackoverflow.com/questions/394616/running-jar-file-in-windows) – javajon Jul 05 '14 at 05:29

1 Answers1

0

If you use NetBeans 8 or JDK 1.8 you have to run the file using Java 8.

If Java 8 is installed on your system and it should be a bundle with NetBeans just point it to your JAVA PATH from Computer Properties Variables.

Zaid Sultan
  • 78
  • 1
  • 9