How to use JavaFX 2 SDK in Eclipse?

后端 未结 8 1557
野性不改
野性不改 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: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)

提交回复
热议问题