如何在Eclipse中使用JavaFX 2 SDK? [英] How to use JavaFX 2 SDK in Eclipse?

查看:449
本文介绍了如何在Eclipse中使用JavaFX 2 SDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了JavaFX 2.0 SDK,现在我想用Eclipse做一个JavaFX应用程序。但是如何在Eclipse中使用 javafx。* 类?



官方JavaFX Eclipse插件似乎是针对JavaFx 1.2而过时的。



当我尝试安装 e(fx)剪辑插件时,我收到以下错误: / p>

 无法找到一个或多个所需项目,因此无法完成安装。 
正在安装的软件:efxclipse 0.0.8.201111131640(at.bestsolution.efxclipse.feature.feature.group 0.0.8.201111131640)
缺少要求:JavaFX的Eclipse DI集成0.0.8.201111131640(at.bestsolution.efxclipse。 runtime.di 0.0.8.201111131640)需要bundle org.eclipse.e4.core.contexts 0.9.0但是找不到
无法满足依赖关系:
From:efxclipse 0.0.8.201111131640(at。 bestsolution.efxclipse.feature.feature.group 0.0.8.201111131640)
至:at.bestsolution.efxclipse.runtime.feature.feature.group [0.0.8.201111131640]
无法满足依赖关系:
从:FX Runtime 0.0.8.201111131640(at.bestsolution.efxclipse.runtime.feature.feature.group 0.0.8.201111131640)
To:at.bestsolution.efxclipse.runtime.di [0.0.8.201111131640]


解决方案

有两个选项:



1)编辑:由于7u35(或近距离),JavaFX被包含进入基础JDK类路径,以便您可以立即使用JavaFX类。



只需设置您的项目以使用fx libs:



JavaFX 2.0 API是纯Java。因此,您可以创建一个新的Java项目,并将 sdk-path / rt / lib / jfxrt.jar 添加到库中以在该项目中使用JavaFX。



对于JDK7路径中的配套构建将在下一个 jdk-path / jre / lib / jfxrt.jar



2)使用e(fx)剪辑插件: http:/ /www.eclipse.org/efxclipse/index.html


I have installed JavaFX 2.0 SDK and now I would like to do an JavaFX application with Eclipse. But how can I use the javafx.* classes in Eclipse?

The official JavaFX Eclipse plugin seem to be for JavaFx 1.2 and outdated.

When I try to install e(fx)clipse plugin, I get this error:

Cannot complete the install because one or more required items could not be found.
  Software being installed: efxclipse 0.0.8.201111131640 (at.bestsolution.efxclipse.feature.feature.group 0.0.8.201111131640)
  Missing requirement: Eclipse DI integration for JavaFX 0.0.8.201111131640 (at.bestsolution.efxclipse.runtime.di 0.0.8.201111131640) requires 'bundle org.eclipse.e4.core.contexts 0.9.0' but it could not be found
  Cannot satisfy dependency:
    From: efxclipse 0.0.8.201111131640 (at.bestsolution.efxclipse.feature.feature.group 0.0.8.201111131640)
    To: at.bestsolution.efxclipse.runtime.feature.feature.group [0.0.8.201111131640]
  Cannot satisfy dependency:
    From: FX Runtime 0.0.8.201111131640 (at.bestsolution.efxclipse.runtime.feature.feature.group 0.0.8.201111131640)
    To: at.bestsolution.efxclipse.runtime.di [0.0.8.201111131640]

解决方案

There are two options:

1) EDIT: Since 7u35 (or smth near it) JavaFX was included into base JDK classpath so you can use JavaFX classes right away.

Just set up your projects to use fx libs:

JavaFX 2.0 API is pure Java. So you can create a new Java project and add sdk-path/rt/lib/jfxrt.jar to libraries to use JavaFX in that project.

For cobundled builds in JDK7 path would be next jdk-path/jre/lib/jfxrt.jar

2) Use e(fx)clipse plugin: http://www.eclipse.org/efxclipse/index.html

这篇关于如何在Eclipse中使用JavaFX 2 SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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