简体   繁体   English

Mac上的JRE系统库中不存在JavaFX JAR

[英]JavaFX JAR does not exist in JRE System Library on Mac

I have a MacBook Pro 2018. I installed Java a couple of months ago and the current version of Java that I have installed is 10.0.2. 我有一台MacBook Pro2018。几个月前安装了Java,当前安装的Java版本是10.0.2。 I tried to use JavaFX on eclipse but it gives an error (see images below). 我试图在eclipse上使用JavaFX ,但它给出了一个错误(请参见下图)。 The JAR exists in the installed JDK library but eclipse is not able to recognize it. JAR存在于已安装的JDK库中,但是eclipse无法识别它。 I've tried to configure the build path and modify the access rules to allow JavaFX to run. 我试图配置构建路径并修改访问规则以允许JavaFX运行。 I even added the JavaFX JAR externally but it did not run. 我什至在外部添加了JavaFX JAR但它没有运行。

error screenshot 1 error screenshot 2 error screenshot 3 error screenshot 4 错误截图1 错误截图2 错误截图3 错误截图4

Make sure your project is set up for Java 10 source compliance. 确保您的项目设置为符合Java 10源标准。 Select Project -> Properties from the menu, go to Java Compiler, and make sure the compiler compliance level is set to 10. 从菜单中选择Project-> Properties,转到Java Compiler,并确保将编译器的遵从级别设置为10。

When you select the JDK for your project or the default setting for Eclipse, make sure that you do not select an "Execution environment" but instead explicitly select an installed JDK. 当选择项目的JDK或Eclipse的默认设置时,请确保您没有选择“执行环境”,而是明确选择了已安装的JDK。 JavaFX is not part of an execution environment. JavaFX不是执行环境的一部分。

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

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