-
Notifications
You must be signed in to change notification settings - Fork 5
Setting up an IDE
This wiki page contains information needed to set up the recommended IDE for the k.LAB project.
The strategy is to build the project via command line with Maven and then import it into Eclipse
- OpenJDK 17 - You can download a copy of the JDK from: https://adoptium.net/temurin/releases/
- Git - https://github.com/git-guides/install-git
Go to the Eclipse Temurin and download the latest version of Java 17 for your operative system (Linux, Windows, MacOS).
Choose where do you want to install Java. For example, /usr/java
.
Extract the downloaded .tar.gz
file (tar xvf
) and move its content to that directory.
Check if Java JDK 17 is installed by running java --version
.
If not, run update-alternatives --config java
and choose the correct version.
Choose where do you want to install Java. For example, C:\Program Files\Java
.
Unzip the downloaded file and move its content there.
In the Control Panel go to System, click Advanced and then System Variables.
Create a new System Variable named JAVA_HOME
. Use the path to the Java folder as the variable name.
Add %JAVA_HOME%\bin
to the Path.
Apply the changes. Check the Java version in the command line by running java --version
.
You need to install Java and Maven. Make sure JAVA_HOME
environment variable is properly configured, and $JAVA_HOME/bin
is part of your $PATH
$ git clone git@github.com:integratedmodelling/klab.git
$ cd klab
$ MAVEN_OPTS="-Xmx2g" ./mvnw clean install -DskipTests
💡 Note: Change ./mvnw
for mvnw.cmd
on Window systems
Download Eclipse IDE for Java and DSL Developers, version 2022-09 and install it.
Be sure to download the JAVA and DSL Developers package, the 5th in the list
This tutorial will assume that the user has downloaded the recommended version. Errors caused by alternative IDEs or versions are not covered in this tutorial.
After the initial startup and before any other step, you must disable Build Automatically option.
Download the following plugins from the Eclipse marketplace.
Go to menu option Help
> Eclipse Marketplace...
and search and install for the following plugins:
-
Groovy Development Tools
-
Eclipse Nebula Incubation Widgets
-
Eclipse Nebula Stable Widgets
-
Lombok:
We need to get the Lombok jar first. The latest version is located on [Maven Central] (https://mvnrepository.com/artifact/org.projectlombok/lombok).
For our example, we’re using lombok-1.18.32.jar.
Next, we can run the jar via java -jar command, and an installer UI will open.
java -jar lombok-1.18.32.jar
This tries to automatically detect all available Eclipse installations, but it’s also possible to specify the location manually.
Once we’ve selected the installations, we press the Install/Update button:
After installing the required plugins and restart Eclipse. You can import the built project into your workspace.
See: Importing existing projects from Eclipse documentation.
After importing the project, the IDE might complain about an error regarding the API baseline.
Despite being marked as an error, this issue does not affect the project. Therefore, the severity can be safely lowered to a warning. Right click on the error and select "Quick fix".
On the next window, select "Configure API problem severity" and "Finish".
At the new window, modify the "Missing API baseline" level to "Warning". Apply changes and recompile.
The project is ready to work with Java 11. The compiler compliance level con be seen at the "Preferences" menu. Go to "Java"->"Compiler" to see the options for the compiler version.
By default, Eclipse uses its own JRE, which causes some compatibility issues at the k.LAB projects. To modify the default JRE definition go to the "Preferences" menu. Then, "Java"->"Installed JREs".
In this screen, select "Add.." and include OpenJDK 17 (see the section about requirement) to the build path.
Select the new JDK as the default definition, save and close.