Build and Run an Application
Create a MicroEJ Standalone Application
Create a project in your workspace. Select File > New > MicroEJ Standalone Application Project.
Fill in the application template fields, the Project name field will automatically duplicate in the following fields. Click on Finish. A template project is automatically created and ready to use, this project already contains all folders wherein developers need to put content:
src/main/java
: Folder for future sourcessrc/main/resources
: Folder for future resources (images, fonts, etc.)META-INF
: Sandboxed Application configuration and resourcesmodule.ivy
: Ivy input file, dependencies description for the current project
Right click on the source folder
src/main/java
and select New > Package. Give a name:com.mycompany
. Click on Finish.The package
com.mycompany
is available undersrc/main/java
folder. Right click on this package and select New > Class. Give a name:Test
and check the boxpublic static void main(String[] args)
. Click on Finish.The new class has been created with an empty
main()
method. Fill the method body with the following lines:System.out.println("hello world!");
The test application is now ready to be executed. See next sections.
Run on the Simulator
To run the sample project on Simulator, select it in the left panel then right-click and select Run > Run as > MicroEJ Application.
MicroEJ SDK console will display Launch steps messages.
=============== [ Initialization Stage ] ===============
=============== [ Launching on Simulator ] ===============
hello world!
=============== [ Completed Successfully ] ===============
SUCCESS
Run on the Hardware Device
Compile an application, connect the hardware device and deploy on it is hardware dependant. These steps are described in dedicated documentation available inside the MicroEJ Platform. This documentation is accessible from the MicroEJ Resources Center view.
Note
MicroEJ Resources Center view may have been closed. Click on Help > MicroEJ Resources Center to reopen it.
Open the menu Manual and select the documentation
[hardware device] MicroEJ Platform
, where [hardware device]
is
the name of the hardware device. This documentation features a guide to
run a built-in application on MicroEJ Simulator and on hardware device.