在Java 1.7u80上运行JavaFX应用程序时出现问题 [英] Problems running JavaFX application on Java 1.7u80

查看:717
本文介绍了在Java 1.7u80上运行JavaFX应用程序时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MAC上使用Netbeans 8.02并且正在从New Project Wizard创建一个简单的JavaFX应用程序。



当我将平台设置为Java 1.8时它只能工作很好,但是当我尝试在Java 1.7u80上运行它时,我得到java.lang.NoClassDefFoundError:javafx / application / Application。从IDE或命令行运行时的行为是相同的。



任何平台都可以编译得很好,所以它看起来像JavaFX在类路径上我安装的平台。



我的目标应用程序必须在1.7上运行,因此我不能简单地使用1.8并将其称为一天。

解决方案

事实证明我遇到了NetBeans IDE中的这个已知错误。



https:// netbeans。 org / bugzilla / show_bug.cgi?id = 239388



听起来路径设置导致ide使用为平台V构建的Ant脚本1.8意外。



我将Netbeans本身的平台更改为JDK 1.7,现在一切都很好地构建为1.7并使用JDK 1.7u80 100%运行JavaFX应用程序。 / p>

I am using Netbeans 8.02 on the MAC and am creating a simple JavaFX application from the New Project Wizard.

When I set the platform to Java 1.8 it works just fine, but when I try to run it on Java 1.7u80 I get "java.lang.NoClassDefFoundError: javafx/application/Application". Behavior is the same when running from the IDE or from the command line.

Everything compiles just fine with either platform, so it does look like JavaFX is on the classpath for both platforms I have installed.

My target application will have to run on 1.7, so I cannot simply go with 1.8 and call it a day.

解决方案

It turns out I ran into this known bug in NetBeans IDE.

https://netbeans.org/bugzilla/show_bug.cgi?id=239388

It sounds like the path settings is causing the ide to use the Ant script which builds for platform V 1.8 by accident.

I changed the platform for Netbeans itself to be JDK 1.7 and now everything builds fine for 1.7 and runs the JavaFX app 100% using JDK 1.7u80.

这篇关于在Java 1.7u80上运行JavaFX应用程序时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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