I am trying to build and package a sample JavacPlugin project into a jar
file. The project can be inspected here:

https://github.com/malakeel/java-compiler-plugin-example


The error I am getting:

[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 2 source files with javac [debug verbose target 21] to
target/classes
An exception has occurred in the compiler (21). Please file a bug against
the Java compiler via the Java bug reporting page (
https://bugreport.java.com) after checking the Bug Database (
https://bugs.java.com) for duplicates. Include your program, the following
diagnostic, and the parameters passed to the Java compiler in your report.
Thank you.
java.util.ServiceConfigurationError: com.sun.source.util.Plugin: Provider
com.example.JavacPlugin not found
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)

I am using openjdk version "21"

While I understand the problem in general, I am unable to find the exact
cause.

Why is the compiler plugin unable to locate the given class, and what
options do I need to set to make this work ?
Thank you in advance.

Reply via email to