Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

How to use JavaFX 2 SDK in Eclipse?

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]
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...