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!

1 Like

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:


1 Like

I am receiving this same issue with ByteBuffer. The rest of my libraries are recognized, but when SOAR attempts to link I get the following message:

Class ‘java.nio.ByteBuffer’ is referenced, but cannot be loaded: 'VERIFIED_REJECTED

I checked several of the examples, but I don’t see an issue. This project builds fine in the SDK, but I run into this when trying to build from the command line.

Did you add this library to your classpath (using ivy or project configuration) ?

Yes I did. In the -ivy-provisioning:resolve: section of running the build script it finds all the libraries, also everything appears to compile correctly. It’s when it gets to the point of linking that it can’t seem to find them.