Eclipse Setup

You first need to setup an Eclipse environment for general Lyo development:

  1. Unless already installed, install JDK 21 to use Lyo 7.0 or newer. Earlier versions of Lyo may require JDK 17 (Lyo 6), JDK 11 (Lyo 5), or JDK 8 (Lyo 4).
    1. Maven version 3.8 or higher is required.
    2. Pro tip: use SDKMAN! to install multiple versions of JDK and Maven and switch between them depending on the project. We recommend sdk install java 21-tem provided by Eclipse Temurin as your default JDK.
  2. Install Eclipse IDE for Java EE Developers distribution. Alternatively, you need to install the plugins included in the JEE release, such as Eclipse Java EE Developer Tools and Eclipse Java Web Developer Tools.
  3. Once Eclipse is installed, you need to make sure the JAVA_HOME environment variable is set to the installed JDK (instead of the default JRE).
    1. Select Window➞Preferences.
    2. Select Java➞Installed JREs.
    3. Click Add...
    4. In the new window that appears,
      1. Choose Standard VM as JRE Type.
      2. Click Next.
      3. As JRE home choose the installation dir of your JDK.
      4. Click Finish.
    5. Back to the preferences screen:
      1. Select the old JRE.
      2. Click Remove.
      3. Check the newly added JDK, and
      4. Click OK.

Eclipse M2E expects JAVA_HOME to be defined in the OS environment variables. This presents some challenges on macOS because Eclipse.app does not typically run from a user shell. To avoid having to start Eclipse.app from a Terminal, use launchctl set an environment variable to be set on all future processes launched by launchd in the caller's context. For example:

launchctl setenv JAVA_HOME /Users/{userId}/.sdkman/candidates/java/current

Substitute your user id for {userId}. If not using SDKMAN!, use the path to your Java 21 installation. After a reboot, JAVA_HOME will be set to your current SDKMAN! JDK.