简体   繁体   English

如何在每个操作系统上运行JavaFX项目

[英]How to run JavaFX project on every OS

I created default JavaFX project in Netbeans which runs on Linux. 我在Linux上运行的Netbeans中创建了默认JavaFX项目。 I tried to run the generated jar file on Windows but the JavaFX cannot be found. 我试图在Windows上运行生成的jar文件,但是找不到JavaFX。 This is the configuration of the jar file. 这是jar文件的配置。

在此处输入图片说明

How I can configure the jar file to use specific JVM for the OS on which the Jar file is deployed. 如何配置jar文件以将特定的JVM用于部署Jar文件的操作系统。

Even late, I try to propose an answer: 甚至迟了,我尝试提出一个答案:

Obviously on each OS, the JVM location is different. 显然,在每个操作系统上,JVM的位置都不同。

  1. Since 1.7.0_40 or 41 , if I remember well, or JDK8, JavaFX library is embedded in the JDK so no need to worry about your issue. 从1.7.0_40或41开始,如果我还记得JDK8或JDK8,则JavaFX库嵌入在JDK中,因此无需担心您的问题。
  2. If this is a JVM lookup issue, you might want to set JAVA_HOME system property, or set the default running JDK of NetBeans or default projects JVM. 如果这是JVM查找问题,则可能要设置JAVA_HOME系统属性,或者设置NetBeans的默认运行JDK或默认项目JVM。
  3. You might also use a build tool such as Maven in order to let dev's on different OS set different JVM location in private properties file. 您还可以使用诸如Maven之类的构建工具,以便让不同操作系统上的开发人员在私有属性文件中设置不同的JVM位置。

You shouldn't add manually library as we've done many years ago ;) 您不应该像我们很多年前那样手动添加库;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM