在Linux上的JavaFX运行时JAR文件jfxrt.jar的位置是什么? [英] What's the location of the JavaFX runtime JAR file, jfxrt.jar, on Linux?

查看:1252
本文介绍了在Linux上的JavaFX运行时JAR文件jfxrt.jar的位置是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用Eclipse Kepler运行一些JavaFX代码, e(fx)clipse 插件安装在Linux机器上,使用:

I'm trying to run some JavaFX code with Eclipse Kepler, with e(fx)clipse plugin installed, on a Linux machine, using:

java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-5)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

我的理解是,尽管JavaFX自JDK 7u6版本以来已经包含在标准JDK中,但是JavaFX运行时JAR文件jfxrt.jar已经被有意义地停留在Java运行时路径上,直到JavaFX和其他Java基础架构之间的进一步测试已经完成。因此,当我们创建一个新的Java项目时,您必须手动将其添加到项目构建路径库中。

My understanding is that although JavaFX has been included with the standard JDK since version JDK 7u6, the JavaFX runtime JAR file, jfxrt.jar, was left off of the Java runtime path on purpose until further testing between JavaFX and rest of the java infrastructure has been completed. For this reason you must manually add it to the project build path libraries when we create a new Java project.

我一直在找到以下目录中的该jar没有成功:

I've been looking for that jar in both the following directories without success:

/usr/lib/jvm/java-7-openjdk-common/jre/lib/
/usr/lib/jvm/java-7-openjdk-amd64/lib

为了这个吗?

推荐答案

在Java Java 7中,jfxrt.jar的位置是:

The location of jfxrt.jar in Oracle Java 7 is:

<JRE_HOME>/lib/jfxrt.jar



The location of jfxrt.jar in Oracle Java 8 is:

<JRE_HOME>/lib/ext/jfxrt.jar

< JRE_HOME> 将依赖在安装Oracle Java的地方,可能在Linux发行版和安装之间有所不同。

The <JRE_HOME> will depend on where you installed the Oracle Java and may differ between Linux distributions and installations.

jfxrt.jar不在Linux OpenJDK 7中(这是您正在使用的)。

jfxrt.jar is not in the Linux OpenJDK 7 (which is what you are using).

A提供基于Debian的系统的JavaFX 8(如Ubuntu)的开源软件包可用。要安装此软件包,需要安装Debian OpenJDK 8软件包和Debian OpenJFX软件包。我不运行Debian,所以我不知道Debian OpenJFX软件包在哪里安装jfxrt.jar。

An open source package which provides JavaFX 8 for Debian based systems such as Ubuntu is available. To install this package it is necessary to install both the Debian OpenJDK 8 package and the Debian OpenJFX package. I don't run Debian, so I'm not sure where the Debian OpenJFX package installs jfxrt.jar.

使用 Oracle Java 8

对于Oracle Java 8,JavaFX都包含在JDK中,位于默认的类路径上。这意味着JavaFX类在构建过程中由编译器自动发现,当用户使用您的应用程序时,它们将被运行时自动发现。所以使用Oracle Java 8目前是您的问题的最佳解决方案。

With Oracle Java 8, JavaFX is both included in the JDK and is on the default classpath. This means that JavaFX classes will automatically be found both by the compiler during the build and by the runtime when your users use your application. So using Oracle Java 8 is currently the best solution to your issue.

OpenJDK for Java 8可能包括JavaFX(因为JavaFX for Java 8现在是开源的),但是将依赖OpenJDK软件包汇编程序来确定它们是否选择将JavaFX 8与其发行版一起使用。我希望他们这样做,因为它应该有助于消除您在问题中遇到的困惑,并且还在OpenJDK中提供了更多的功能。

OpenJDK for Java 8 could include JavaFX (as JavaFX for Java 8 is now open source), but it will depend on the OpenJDK package assemblers as to whether they choose to include JavaFX 8 with their distributions. I hope they do, as it should help remove the confusion you experienced in your question and it also provides a great deal more functionality in OpenJDK.


我的理解是,尽管JavaFX自JDK 7u6版本以来已经包含在标准JDK中

My understanding is that although JavaFX has been included with the standard JDK since version JDK 7u6

是的,但只有Oracle JDK。

Yes, but only the Oracle JDK.

与Java 7捆绑在一起的JavaFX版本并不完全是开源的,所以它不能包含在OpenJDK中(这正是您正在使用的)。

The JavaFX version bundled with Java 7 was not completely open source so it could not be included in the OpenJDK (which is what you are using).

您需要使用Java 7而不是Java 8,您可以下载 Oracle JDK for Java 7 并使用它。 JavaFX将随Java 7一起提供。由于Oracle配置Java 7的方式,JavaFX不会在类路径上。如果您使用Java 7,则需要将其添加到类路径并使用适当的JavaFX打包工具以允许您的用户运行您的应用程序。一些工具,如e(fx)剪辑和NetBeans JavaFX项目类型将为您处理类路径问题和打包任务。

In you need to use Java 7 instead of Java 8, you could download the Oracle JDK for Java 7 and use that. Then JavaFX will be included with Java 7. Due to the way Oracle configured Java 7, JavaFX won't be on the classpath. If you use Java 7, you will need to add it to your classpath and use appropriate JavaFX packaging tools to allow your users to run your application. Some tools such as e(fx)clipse and NetBeans JavaFX project type will take care of classpath issues and packaging tasks for you.

这篇关于在Linux上的JavaFX运行时JAR文件jfxrt.jar的位置是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆