Getting Started with MicroEJ 
Tags: poweredbymicroej
Published: 2021-09-27 16:38:05

Based on my first contact with [MicroEJ](https://www.microej.com) technology and a little bit of research, I decided to make a short introduction to this interesting technology. I am going to talk a little bit about the history behind it, where it can be used and how to install and run a Hello World example.

##Who is MicroEJ?


MicroEJ is a French company who has created a development application kit focused on embedded systems and IoT, using C, Java® technologies and recently JavaScript® as a programming language. The main objective of this development kit is to help developers create applications for devices which require a high level of performance, compact size, energy efficiency, while still enjoying all the benefits of a high level language such as, Java® or JavaScript®.

Currently, [MicroEJ](https://www.microej.com) has three products available:

[MICROEJ VEE](https://www.microej.com/product/vee/): A virtual machine that can run on devices with very low computing power, including microcontrollers, microprocessors and SoT. It includes free libraries and [MEJ32](https://developer.microej.com/mej32-virtual-software-processor-for-embedded-systems/).
[MICROEJ SDK](https://www.microej.com/product/sdk/): An application development kit, that involves a complete pack of tools and a library, to develop applications that will run on the MICROEJ VEE virtual machine. As well as  that, it is possible to create embedded systems simulators called Virtual Devices.
[MICROEJ Forge](https://www.microej.com/product/forge/): A cloud technology that helps developers and companies to store applications, assets, libraries and more.

##History:

MicroEJ was founded in 2004, by [Fred Rivard](https://www.linkedin.com/in/fredrivard/) PhD. and went by  the name of Industrial Smart Software Technology (IS2T). After a first phase of research and development, the company grew and raised investment with Innovacom at the end of 2011. The company was renamed to [MicroEJ](https://www.microej.com), with the challenge of building a virtualization core that needed to be 1000 times lower than Android, to standardize and viabilize the development of applications to more than 10 billion devices that are fabricated every year, embedded devices and IoT. 

Currently, MicroEJ technology runs on 100 million devices, in various industry sectors across manufacturing, smart home, wearables, retail, healthcare, metering, utilities, industrial, consumer, defense, etc.


##Installation on Windows(7, 8, 8.1, 10):

To start the installation, first you have to go to the [official MicroEJ download page](https://developer.microej.com/get-started/) and [download](https://repository.microej.com/packages/SDK/21.03/MicroEJ-SDK-Installer-Win64-21.03.exe) the [SDK](https://developer.microej.com/get-started/). The site has all the necessary information for installation, including the necessary requirements and information about what comes installed in the SDK. For the SDK to run on your computer,  you will need to have [JRE8](https://www.oracle.com/br/java/technologies/javase-jre8-downloads.html) installed on your PC.

![Get Started](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6d48htmfjcy4swmajo9f.png)

Then just follow the standard Windows installation by clicking next, accept the terms of use, and follow the process by clicking next until you complete the steps and the IDE installation is finished.

![Step one of the installation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6hf3f2fm8rfmc24cx49.png)

![Step two](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m8rm4hcgvvxmhs5jbdfq.png)

![Step three](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2276jwrporqzjr33c1gp.png)

![Step four](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t22u8wiu5nlzx63h7tkc.png)

![Step five](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rg0pztwf9h4zjqbpvuqe.png)

![Step six](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rbcdxxa73qqmp8lm4vwt.png)

##Running the basic Hello World in Java:

After starting the IDE, creating a MicroEJ program is quite simple, just go to "File" > "New" > "Standalone Application Project"

![creating a project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ed777te764bsq4ycmo6.png)

Then, give the name of the project and the module name will be filled automatically

![building the project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mdhhlbuy6uk1ee95qd10.png)

When you click "Finish", the Main.java class is built

![Main class built](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pizxdq15qj6wrccvap9q.png)

Since this is a Main class with Hello World, to run it just right-click on the file, "Run As" > "MicroEJ Application".

![Run as MicroEJ application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/60kx3jlu4wm8q6zzvni4.png)

After running, the console will display the following message:

```
Hello World!
=============== [ Completed Successfully ] ===============

SUCCESS
```
##Hello World with MicroEJ Template and Emulator

To run the [MicroEJ](https://www.microej.com) [Hello World template](https://repository.microej.com/packages/blue/2.0.2/applications/blue_firmware_applications_1.0.0.zip), first, you need to install one of the virtual device emulators, in this case, I'll use the [NXP OM13098](https://developer.microej.com/create-your-first-application/get-started-app-development-on-nxp-om13098-lpcxpresso54628/). After downloading it, save it in your workspace. Run the MicroEJ IDE, go to "Window" > "Preferences" > "MicroEJ" > "Virtual Device menu".

![Virtual Devices](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sup16knlk8drqpvpxjwz.png)

The next step is to import the emulator and select the directory where the emulator is saved.

![Select the directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/krxn1wo0fo63am4149st.png)

![Directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u035ivqoptxrwt6egnl2.png)

After selection, simply accept the terms of use of the emulator, click "finish", wait for the import process to finish and click "apply and close".The emulator will be installed and ready for use.

![License Agreement](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/amwws4iwu7sruosx6mx6.png)

![Importing the Device](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d2k6vr4ffgob3blwiblf.png)

![Device ready to use](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdefs0qh6j2nleour192.png)

To demonstrate the execution of the virtual device, I will use the [Hello World template provided by MicroEJ for download](https://repository.microej.com/packages/blue/2.0.2/applications/blue_firmware_applications_1.0.0.zip). The template comes ready to run, you only need to import the file to the IDE after unzipping it. Unlike the HelloWorld in the first example, this one has to be executed by right-clicking on the folder as it contains more than one file. Follow the same steps: “Run As” > “MicroEJ Application”.

![Run as MicroEJ Application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yk8nauj2xbnpw0zrq80a.png)

This should be the result in the [NXP OM13098](https://developer.microej.com/create-your-first-application/get-started-app-development-on-nxp-om13098-lpcxpresso54628/) virtual device:

![Result in the NXP OM13098 virtual device](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cw08a3zr9bl8qajcsdu1.png)

Remember that [MicroEJ](https://www.microej.com) supports execution on various types of simulators, such as [STM32](https://developer.microej.com/create-your-first-application/get-started-app-development-on-stmicroelectronics-stm32f746g-disco/), [ESP32](https://developer.microej.com/create-your-first-application/get-started-app-development-on-espressif-esp32-wroverkit-v41/) and more.

Conclusion:
	[MicroEJ](https://www.microej.com) is a very interesting technology, focused on development for embedded devices, that makes it possible to run Java® technology on microcontrollers with low computing power and even IoT. It has a very easy installation and setup due to the Java® programming language used. Also the IDE is well known by software developers as they use Eclipse, and they provide a well-organized [forum](https://forum.microej.com) and [specific site for developers](https://developer.microej.com) in addition to its own [repository](https://repository.microej.com). This provides a great help for those who are starting out or are just curious to know more about how to create Java® applications for MCUs.

I am Oderlan Freire from Ocara, Ceará. I started working at TotalCross in 2021, a student of Information Systems at the Federal University of Ceará, and I participated in the SharinAgro project, one of the top projects selected for the Microsoft contest IA for Earth.