This guide demonstrates how to setup Eclipse so it can be used with the Processing 4 libraries. Processing 4 requires Java 17 or later. Java 21 is a long term support edition and works with Processing 4.

Install the Java Development Kit (JDK)

Download JDK 21 from Oracle.

https://www.oracle.com/java/technologies/downloads/#java21

Choose the version for your operating system (Linux, macOS, Windows).

For macOS, the version labeled ARM64 is for Apple Silicon (M1, M2, etc). The version labeled x64 is for Intel. In both cases, the DMG Installer makes the installation easier.

Run the installer and complete the process. The default options are acceptable.

Install Eclipse

Download Eclipse.

https://www.eclipse.org/downloads/

For macOS, the version labled x86_64 is for Intel. The version labeled AArch64 is for Apple Silicon.

Run the installer. Choose Eclipse IDE for Java Developers. All other default options are acceptable.

Run Eclipse

Run Eclipse. It is easy to accidentally run the installer again instead of running Eclipse.

The first time Eclipse opens, it prompts for a workspace location. The default is acceptable. There is a checkbox that sets the selected workspace as the default. Checking the box prevents Eclipse from asking for a workspace location each time it is run.

The first time Eclipse opens, it displays a welcome window. Close the window (top left). Eclipse may also open a web browser window asking for a donation.

Set Eclipse to use Java 21

The steps below set Eclipse to use Java 21 as the default for all Eclipse projects. It is possible to use different versions of Java for different Eclipse projects (which is not shown here).

Step 1: Open Eclipse Preferences

Open the Eclipse Preferences window.

macOS: Eclipse -> Settings

Windows: Window -> Preferences

Step 2: Add JRE 21

Select Java -> Installed JREs.

If Java 21 is already in the list and selected as the default, skip to Step 3.

Click the Add button.

Select Standard VM and click the Next button.

For the JRE home field, click the Directory button.

Navigate to the directory with the JRE 21.

macOS default: /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home

Windows default: C:\Program Files\Java\jdk-21

For the JRE name, enter Java 21.

Click the Finish button.

If it is not already selected, select the check box next to the newly added Java 21.

Click the Apply button.

Step 3: Set compiler compliance level to 21

In the Eclipse Preferences window, select Java -> Compiler.

Set the Compiler compliance level to 21. (If the Compiler compliance level is already at 21, do not change it.)

Click the Apply and Close button.

If asked to Rebuild, click the Yes button.

Comments

Comment on Setting up Eclipse