Search code examples
javaintellij-ideaintellij-plugin

IntelliJ IDEA VM options


I started creating a custom plugin using the IntelliJ IDEA. As soon as I extend an action from AnAction, override abstract methods and hit run plugin, I get Unable to start DebugAttachDetector, please add --add-exports java.base/jdk.internal.vm=ALL-UNNAMED to VM options

What is this. I tried adding this in settings/build, exec../compiler/java compiler under Override compiler parameters but still does not work. What am I to do :(

enter image description here


Solution

  • As runIde has the type RunIdeTask which extends Gradle's JavaExec task, you can use usual jvmArgs to configure launched JVM instance.

    So, the following should remove the warning. Groovy DSL:

    runIde {
        jvmArgs '--add-exports', 'java.base/jdk.internal.vm=ALL-UNNAMED'
    }
    

    Kotlin DSL:

    tasks.runIde {
        jvmArgs("--add-exports", "java.base/jdk.internal.vm=ALL-UNNAMED")
    }
    

    Not that it changes much as yole mentioned in the comment.