Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java FX in Eclipse on Mac OSX 10.7

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

Problem:

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

  • The jdk is installed within /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 later is not possible since the file open dialog of eclipse does not allow to navigate to the inside of the package

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

Simply go to a terminal and execute the following:

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

This creates the symbolic link 1.7.0.jdk_Contents using super user permissions (sudo).

By this compilation and execution of JavaFx code works fine and as expected.

like image 207
E.S. Avatar asked Nov 03 '22 23:11

E.S.


1 Answers

It's not need to do all said before, just use a allmost unknown behaviour of Finder dialogs: Drag & Drop. You can open a Finder window from console with:

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

so yo will see jfxrt.jar and other .jar files. Drag this files to Eclipse's Add external jar dialog window... et voila! Dependencies satisfaced! No link needed!

like image 200
Realeiko Avatar answered Nov 10 '22 00:11

Realeiko