Installation
This chapter will guide you through the installation process of the SDK on your workstation. First check the System Requirements before proceeding.
System Requirements
- Hardware
Intel x64 (Dual-core i5 minimum) or macOS AArch64 (M1) processor
4GB RAM (minimum)
16GB Disk (minimum)
- Operating Systems
Windows 11 or Windows 10
Linux distributions (tested on Ubuntu 20.04 and 22.04)
macOS x86_64 with Intel chip
macOS aarch64 with M1 chip
- Java Runtime Environment
JDK 11 or higher LTS version (
11
,17
or21
) - Eclipse Temurin or Oracle Distributions
Check your JDK version
The SDK requires a JDK 11 or a higher LTS version to be installed and:
The
JAVA_HOME
environment variable set to the path of a JDK.
OR
The
java
executable of a JDK available in thePATH
.
If the JAVA_HOME
is set to a JDK, make sure that it is a JDK 11 or a higher LTS version.
If the JAVA_HOME
is not set, make sure a JDK executable is available in the PATH
environment variable.
To check, run java -version
in a terminal:
$ java -version
openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment Temurin-11.0.15+10 (build 11.0.15+10)
OpenJDK 64-Bit Server VM Temurin-11.0.15+10 (build 11.0.15+10, mixed mode)
If you don’t have a JDK installed, you can download and install one from Adoptium or Oracle.
Configure Repositories
In order to use the SDK Gradle plugins and modules in your project, the Central and Developer repositories must be configured. There are several ways to declare repositories. To get started, you can declare them globally to make them available in all your projects:
Create the folder
<user.home>/.gradle/init.d
if it does not exist.Download and copy
this file
in the previously created folder.
At this stage, you can already build a project from the command line,
for example, by executing the command ./gradlew build
at the root of the project.
But let’s continue the installation process to have a complete development environment.
Note
This configuration makes MicroEJ Central and Developer repositories available to every project. If you have several repositories configuration specific to certain projects, you can refer to multiple repository configuration how-to
SDK EULA Acceptation
The use of MICROEJ SDK 6 requires to accept the SDK EULA.
The acceptance can be done at the project level or system-wide. For a system-wide acceptance, we recommend to define
the accept-microej-sdk-eula-v3-1c
system property in a gradle.properties
file in your Gradle User Home folder $USER_HOME/.gradle/gradle.properties
:
systemProp.accept-microej-sdk-eula-v3-1c=YES
Refer to SDK EULA Acceptation section of Licenses to get more information about SDK EULA, and alternative configurations.
Install the IDE
Using an IDE is highly recommended for developing MicroEJ projects, making the development more comfortable and increasing productivity. The following IDEs are supported:
Android Studio - Minimum supported version is
Hedgehog - 2023.1.1
.IntelliJ IDEA (Community or Ultimate edition) - Minimum supported version is
2021.2
.Eclipse IDE for Java Developers - Versions from
2022-03
to2024-06
are supported.Visual Studio Code - Minimum supported version is
1.89.0
.
Follow their respective documentation to install one of them.
Install the IDE Plugins
Once your favorite IDE is installed, plugins must be installed to develop MicroEJ Applications.
Follow these steps to install the latest stable version of the MicroEJ plugin for Android Studio:
In Android Studio, open the Settings window (menu File > Settings… on Windows and Linux, menu Android Studio > Settings… on macOS).
Go to Plugins menu.
In the search field, type
MicroEJ for Android Studio
:
Click on the Install button.
In the upcoming Third-Party Plugins Notice window, click on the Accept button.
Click on the Restart IDE button.
Warning
There used to be a unique plugin for both Android Studio and IntelliJ IDEA. Each IDE now has its own dedicated plugin,
so if the IntelliJ IDEA MicroEJ
plugin has been previously installed, you should uninstall it and install MicroEJ for Android Studio
instead.
Follow these steps to install the latest stable version of the MicroEJ plugin for IntelliJ IDEA:
In IntelliJ IDEA, open the Settings window (menu File > Settings… on Windows and Linux, menu IntelliJ IDEA > Settings… on macOS).
Go to Plugins menu.
In the search field, type
MicroEJ
:
Click on the Install button.
In the upcoming Third-Party Plugins Notice window, click on the Accept button.
Click on the Restart IDE button.
To install the snapshot version of the MicroEJ plugin, please refer to How To Install MicroEJ Plugin Snapshot Version on Android Studio or IntelliJ IDEA.
Follow these steps to install the latest stable version of the MicroEJ plugin for Eclipse:
In Eclipse, go to Help > Eclipse Marketplace….
In the search field, type
MicroEJ
and press Enter:
Click on the Install button.
Accept the license agreement and click on the Finish button.
In the upcoming Trust Authorities window, check the
https://repository.microej.com
item and click on the Trust Selected button.
In the upcoming Trust Artifacts window, check the Unsigned item and click on Trust Selected button.
In the upcoming window, click on the Restart Now button.
MicroEJ does not provide a dedicated extension for VS Code, but Microsoft provides a extension that brings a useful collection of extensions for Java called Extension Pack for Java. To install this extension:
In Visual Studio Code, open the Extensions tab (Ctrl+Shift+X)
In the search field, type
extension pack for Java
:
Click on the Install button of the extension
This extension is compatible with MicroEJ development, but requires a specific version to be fully functional. Follow these steps to setup Visual Studio Code:
Go to the
Installed
extensions.Right-click on the
Language Support for Java(TM) by Red Hat
extension.Click on
Install Specific Version ...
.Select version
1.32.0
.Once installed, click on the
Restart Extensions
button.If you already opened a Java project in your IDE:
Click on the Java status in the bottom bar.
Select the
Clean Workspace Cache ...
action in the upcoming menu.In the upcoming popup in the bottom-right corner, click on the
Reload and delete
button.
Warning
Unlike other supported IDEs (Android Studio/IntelliJ IDEA/Eclipse), there is no MicroEJ plugin which removes the JDK dependency. As a result, IntelliSense may propose classes and methods from the JDK which are not present in your project dependencies.