Resolving imports for java.nio.ByteBuffer, java.util.Formatter


I am having some trouble importing some of the libraries.

For example, I can see in the MicroEJ documentation, that java.util.Formatter should be supported:

But when I try to import java.util.Formatter in my project, I get an error saying that the import cannot be resolved. I am guessing this is maybe a configuration issue with my project?

I see a similar issue when I try to import java.nio.ByteBuffer. I can see it documented here:

But I get an error “The import java.nio cannot be resolved” when I try to import it. Do you have any ideas how I can resolve? Thanks!


Hi David,

The MicroEJ Java libraries are split in two types (see

  • Foundation Libraries: implementation is specific to the platform ; depends on C ; built-in in the MicroEJ Architectures
  • Add-on Libraries: full java implementation ; available on the MicroEJ Central Repository (ivy repository)

The ByteBuffer and Formatter classes are both available in add-on libraries. You can use it either by adding manually the Jars in your project classpath configuration or using Ivy dependency manager.
Ivy manages automatically the transitive dependencies of a library. You can find here a simple example that uses Ivy to retrieve logging library: . The dependencies are declared in the module.ivy file.

The Formatter library that includes the Formatter class is available here:
The ByteBuffer library that includes the ByteBuffer class is available here:

Most of the typical J2SE classes are available in these libraries:

You can find here a list of all the add-on libraries classes:
And here a list of all the foundation libraries classes:

More information here: