Debug an Application¶
All libraries included in MicroEJ SDK are provided with their source code and resources. The way the sources are retrieved depends on the kind of library (Add-On Library or Foundation Library).
Add-On Library Sources¶
Add-On Library sources are packaged in a dedicated file named
[module_name]-source.jar available in the module directory:
In MicroEJ SDK, sources are automatically connected to Eclipse JDT when the new Add-On Library is added as a module dependency.
On any Java element (type, method, field), press
CTRL-Click to open the implementation:
Then the implementation class is open in read-only mode.
Foundation Library Sources¶
Foundation Library sources are directly included in the implementation file (JAR file) provided by the Platform.
They are located in the following Platform folders:
- javaLibs for generic Foundation Libraries (defaults).
- MICROJVM/javaLibs for Foundation Libraries specific to the MicroEJ Core Engine.
- S3/javaLibs for Foundation Libraries specific to the Simulator.
In MicroEJ SDK, sources can be connected while debugging an Application on Simulator. This ensures to get the exact source code which is executed on your Platform.
Here are the steps to attach Foundation Library sources from a Platform loaded in the workspace:
Open a MicroEJ Application launch,
Select the Source tab (see also Source Tab),
Click on Add… button,
Select Archive item and press OK,
Select the Foundation Libraries from Platform folders and press OK,
You must select the libraries from the Platform project corresponding to the execution Platform (see Execution Tab).
In the debug session the implementation sources will be now displayed.