Java FX in Eclipse on Mac OSX 10.7

Since I had problems compiling JavaFX code from Eclipse on Mac OSX 10.7 using the java 1.7.0_04 development kit, I just want to share my intermediate solution with interested people:

Problem:

  • The jfxrt.jar and other .jar files are not recognized when you select the new jdk issued by oracle as the new jre / jdk in eclipse.

  • jdk is installed in / Library / Java / JavaVirtualMachines / 1.7.0.jdk, which is recognized as a package.

  • Adding the path / Library / Java / JavaVirtualMachines / 1.7.0.jdk / Contents / Home / jre / lib / jfxrt.jar is not possible later, since the eclipse file open dialog does not allow you to go inside the package

Solution: Create a symbolic link from outside the package inside the package and follow the link in the file open dialog box.

Just go to the terminal and do the following:

[0- / Library / Java / JavaVirtualMachines]: sudo ln -s 1.7.0.jdk / Contents / 1.7.0.jdk_Contents

This creates a symbolic link 1.7.0.jdk_Contents using superuser privileges (sudo).

This compilation and execution of JavaFx code is working fine and as expected.

+5
source share
2 answers

No need to do all of the above, just use the completely unknown behavior of the Finder: Drag and Drop dialogs. You can open the Finder window from the console:

open /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre/lib

so yo will see jfxrt.jar and other .jar files. Drag these files into the Eclipse Add external jar ... et voila dialog box! Dependencies are satisfied! Link not required!

+2
source

JavaFX 2.1 jdk1.7.0_u4 e (fx). , , , JavaFX 2.2.

0

All Articles