Writing Kernel APIs

This section lists different ways to help to write kernel.api files.

Default Kernel APIs Derivation

MicroEJ Corp. provides predefined kernel API files for the most common libraries provided by a Kernel. These files are packaged as MicroEJ modules in the Developer Repository under the com/microej/kernelapi organisation.

The packaged file kernel.api can be extracted from the JAR file and edited in order to keep only desired types, methods and fields.

Build a Kernel API Module

  • First create a new module project using the microej-kernelapi skeleton.
  • Create the kernel.api file into the src folder.
  • Right-click on the project and select Build Module.

Kernel API Generator

MicroEJ Kernel API Generator is a tool that help to generate a kernel.api file based on a Java classpath.

In MicroEJ SDK, create a new MicroEJ Tool launch, Run > Run Configurations > MicroEJ Tool, choose your Platform, select Kernel API Generator for the Settings options, and don’t forget to set the output folder.


Define the classpath to use in the Configuration tab, and Press Run. A kernel.api file is generated in the output folder and it contains all classes, methods and fields found in the given classpath.

Category: Kernel API Generator


Group: Classpath


Option Name: kernel.api.generator.classpath

Default value: (empty)

Group: Types Filters

Option(text): Includes Patterns

Option Name: kernel.api.generator.includes.patterns

Default value: **/*.class

Description: Comma separated list of ANT Patterns for types to include.

Option(text): Excludes Patterns

Option Name: kernel.api.generator.excludes.patterns

Default value: (empty)

Description: Comma separated list of ANT Patterns for types to exclude.