gpt4 book ai didi

eclipse - 如何在Eclipse中使用JavaFX 2 SDK?

转载 作者:行者123 更新时间:2023-12-03 08:53:37 25 4
gpt4 key购买 nike

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

official JavaFX Eclipse plugin似乎适用于JavaFx 1.2,并且已经过时。

当我尝试安装e(fx)clipse plugin时,出现此错误:

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]

最佳答案

有两种选择:

1)编辑:由于7u35(或其附近),JavaFX已包含在基本JDK类路径中,因此您可以立即使用JavaFX类。

只需将您的项目设置为使用fx库即可:

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

对于JDK7路径中的已打包版本,下一个jdk-path/jre/lib/jfxrt.jar
2)使用e(fx)clipse插件:http://www.eclipse.org/efxclipse/index.html

关于eclipse - 如何在Eclipse中使用JavaFX 2 SDK?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8241525/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com