Skip to content

Javac – plugin not found

I am trying to make my own Javac plugin but things aren’t going so well already 🙁 I am following this tutorial: and when I want to test the first basic plugin it can’t find it.

When I enter the following command:

javac -cp ./target/classes/javacplugin/ -Xplugin:Getter ./src/main/java/javacPlugin/

I get this error:

plug-in not found: Getter

How do I solve this issue?

This is my sourcetree:

enter image description here

This is my code for the plugin:

package javacplugin;

import com.sun.source.util.JavacTask;
import com.sun.source.util.Plugin;

 * JavacPlugin
public class JavacPlugin implements Plugin {

    public String getName() {
        return "Getter";

    public void init(JavacTask task, String... arg1) {
        Context context = ((BasicJavacTask) task).getContext();
        Log.instance(context).printRawLines(Log.WriterKind.NOTICE, "Hello from " + getName());


This is what’s inside of com.sun.source.util.Plugin:


This is my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="" xmlns:xsi=""


  <!-- FIXME change it to the project's website -->



    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
        <!-- clean lifecycle, see -->
        <!-- default lifecycle, jar packaging: see -->
        <!-- site lifecycle, see -->



I have solved it:

javac -cp ./target/classes -Xplugin:Getter ./src/main/java/javacPlugin/

Is the right command, without /javacplugin.

User contributions licensed under: CC BY-SA
1 People found this is helpful