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 thisfile in the previously created folder.
At this stage, you can already build a project from the command line,
for example, by executing the command ./gradlewbuild 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
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.
Using an IDE is highly recommended for developing MicroEJ projects, making the development more comfortable and increasing productivity.
The following IDEs are supported:
IntelliJ IDEA (Community or Ultimate edition) - Minimum supported version is 2021.2.
Android Studio - Minimum supported version is Hedgehog-2023.1.1.
In the upcoming Third-Party Plugins Notice window, click on the Accept button.
Android Studio Plugin Installation - Third-Party Plugins Notice
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 MicroEJforAndroidStudio instead.
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:
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)
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 LanguageSupportforJava(TM)byRedHat extension.
Click on InstallSpecificVersion....
Select version 1.32.0.
Once installed, click on the RestartExtensions button.
If you already opened a Java project in your IDE:
Click on the Java status in the bottom bar.
Select the CleanWorkspaceCache... action in the upcoming menu.
In the upcoming popup in the bottom-right corner, click on the Reloadanddelete 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.