plexus-compiler icon indicating copy to clipboard operation
plexus-compiler copied to clipboard

javac does not resolve non-default JRE modules / packages

Open fipro78 opened this issue 2 years ago • 0 comments

I created a project that uses API from OpenJ9 to create a checkpoint for a CRIU evaluation. The necessary classes are in the Java module openj9.criu inside the package org.eclipse.openj9.criu. In my setup I have a IBM Semeru JDK with OpenJ9 installed. The IDE is able to resolve and compile the classes. But the Maven build fails with the error:

package org.eclipse.openj9.criu does not exist

If I try to add the module openj9.criu the error message says

module not found: openj9.criu

I opened a ticket at openj9 who also didn't get the issue: https://github.com/eclipse-openj9/openj9/issues/18205

After playing around a bit more, I noticed that switching to the eclipse compiler plugin the compilation succeeds.

For me it looks like [plexus-compiler-javac](https://codehaus-plexus.github.io/plexus-compiler/plexus-compilers/plexus-compiler-javac/) is not really using the JDK that is used to start the Maven build, while [plexus-compiler-eclipse](https://codehaus-plexus.github.io/plexus-compiler/plexus-compilers/plexus-compiler-eclipse/) is using it correctly.

I have created a new branch in my deployment benchmark example repository:

https://github.com/fipro78/osgi_deployment_options/tree/criu

The project that contains the CRIUSupport usage is in org.fipro.osgi.benchmark.criu

If you build from the root directory via

mvn clean verify -Pcriu

you should see the error.

fipro78 avatar Sep 29 '23 08:09 fipro78