Failed to start Javafx from computer by double clicking the jar file
I have created a JavaFx application using Netbeans. It works fine if I run the application from Netbeans. But if I double click on the jar file I get an error like
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 on my PC. But, if I run the jar file from command line like java -jar MyJavaFxApplication.jar
then it works correctly.
My question is somehow similar to the question " Can't run JavaFx Jar with JRE7 ". But this question still remains unanswered.
My Java version:
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.
If you are using NetBeans 8 or JDK 1.8, you need to run the file using Java 8.
If Java 8 is installed on your system and it needs to be bundled with NetBeans, just point it to the JAVA PATH from your computer property variables.