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 17 - 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 the PATH.

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.

Install Gradle

Once a JDK is correctly configured, the next step is to install Gradle by following the official documentation. The SDK is only compatible with the Gradle 8.0.2 and higher, so make sure to install a right version. Once done, you can verify your installation by opening a terminal and run the command gradle -v. It should display, amongst other information, the Gradle and the JVM versions:

 $ gradle -v

------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          11.0.18 (Eclipse Adoptium 11.0.18+10)
OS:           Windows 10 10.0 amd64

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 they do 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 gradle build at the root of the project. But let’s continue the installation process to have a complete development environment.

Install the IDE

Using an IDE is highly recommended for developing MicroEJ projects, making the development more comfortable and increasing productivity. The three following IDEs are supported:

Follow their respective documentation to install one of them.

These 3 IDEs come with the Gradle plugin installed by default.

Install the IDE Plugin

Once your favorite IDE is installed, the MicroEJ plugin must be installed.

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:
Android Studio Installation

Android Studio Plugin Installation

  • Click on the Install button.

  • In the upcoming Third-Party Plugins Notice window, click on the Accept button.

    Android Studio Plugin Installation - Third-Party Plugins Notice

    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 MicroEJ for Android Studio instead.