This guide is for setting up JDK, Eclipse, and JavaFX on MacOS. A video showing this process is available here.

Before we start, remember a few important things:

JDK

Download OpenJDK 11 (Hotspot) from AdoptOpenJDK. Double click on the downloaded .pkg file and follow the instructions.

Eclipse

Download Eclipse IDE for Java Developers from Eclipse.org. Double click on the downloaded .dmg file, and in the opened window, drag Eclipse to Applications.

JavaFX

Download JavaFX 11 Mac OS X SDK from Gluon.com. Unzip the downloaded .zip file to a local folder. We'll refer to this folder as the JavaFX folder.

To create a JavaFX project in Eclipse, follow the instructions in the [JavaFX and Eclipse: Non-modular Project - IDE] section of Getting Started with JavaFX. The key steps are:

--module-path /path/to/javafx/lib --add-modules javafx.controls,javafx.fxml

Uninstallation

Uninstalling JavaFX is simple - just delete the JavaFX folder. Of course any project references JavaFX won't work after that.

To uninstall Eclipse, go to Finder -> Applications, right click on Eclipse and select Move to Trash.

To uninstall JDK, open a Terminal and run the following command:

ls /Library/Java/JavaVirtualMachines

It will show the JDK you currently have. To remove it, run the following command

sudo rm -r /Library/Java/JavaVirtualMachines/<jdk-version>.jdk

where <jdk-version> is the name of the JDK.

If it is an Oracle JDK, it may also have some files in other folders. See this Stackoverflow question on how to get rid of those files.

Last Updated: 10/24/2020 22:19 Views: 6611