双击jar文件无法从计算机运行Javafx [英] Unable to run Javafx from computer by double clicking the jar file
问题描述
我使用Netbeans创建了一个JavaFx应用程序。它运行正常,如果我从Netbeans运行应用程序。但是,如果我双击jar文件,我收到错误消息
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,但需要JavaFx。从javafx.com/javafx获取JavaFx运行时并运行安装程序。然后重新启动应用程序
但我已经在我的电脑上安装了JavaFX运行时。但是,如果我从命令行运行jar文件为 java -jar MyJavaFxApplication.jar
,那么它正在正常运行。
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.
我的问题在某种程度上类似于问题无法使用JRE7运行JavaFx Jar 。但是这个问题仍然没有答案。
My question is somehow similar to the question "Unable to run JavaFx Jar with JRE7". But that question still unanswered.
我的Java版本是:
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)
提前致谢。
推荐答案
如果使用NetBeans 8或JDK 1.8,则必须使用Java 8运行该文件。
If you use NetBeans 8 or JDK 1.8 you have to run the file using Java 8.
如果系统上安装了Java 8,则应该是NetBeans的捆绑包,只需将它从计算机属性变量指向您的JAVA PATH。
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.
这篇关于双击jar文件无法从计算机运行Javafx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!