How to use JavaFX 2 SDK in Eclipse?

后端 未结 8 1523
野性不改
野性不改 2020-12-01 09:21

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 of

相关标签:
8条回答
  • 2020-12-01 09:41

    To install the e(fx)clipse tooling into your already existing Eclipse you have to add an Update site.

    There's no released yet available so you need to add the nightly update-site http://download.eclipse.org/efxclipse/updates-nightly/site

    0 讨论(0)
  • 2020-12-01 09:43

    Based on Sergey Grinev solution, I noticed that we can define this once for all java projects.

    1. Go to Preferences -> Java build path
    2. Select the jvm which is supposed to support javaFx (but whose feature is not yet recognized in Eclipse) and Edit it
    3. Add the sdk-path/rt/lib/jfxrt.jar to it

    This way, all your java projects based on this JVM version can support JavaFx and even your older projects (Select each project build path and eventually replace the old jvm with the jvm that you've just edited)

    0 讨论(0)
  • 2020-12-01 09:47

    You can use e(fx)clipse! You can find it here: http://www.eclipse.org/efxclipse/index.html

    After download you must to configure the IDE with your JavaFX SDK(must be installed).

    All you need to do is to open Window > Preferences > JavaFX and configure the location of your JavaFX-SDK.

    You ussualy have it in Program Files > Oracle.

    Hope this will help you!

    0 讨论(0)
  • 2020-12-01 09:48

    To access JavaFx in Java8 with Eclipse Luna (4.4):

    Go to Build Path/ JRE/ Access rules/ Edit/ Add/ Accessible: javafx/**

    This seems better than editing the classpath file manually or adding the JAR (again) to the build path.

    0 讨论(0)
  • 2020-12-01 09:57

    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

    0 讨论(0)
  • 2020-12-01 10:01

    I installed Eclipse Neon.1 (4.6.1) Then Help => Eclipse Marketplace On find specify "javaFX" and install "e(fx)clise 2.4.0"

    0 讨论(0)
提交回复
热议问题