Search code examples
javamavenintellij-ideagraalvmgraalvm-native-image

ADD MAVEN_OPTS Intellij


I'm trying to package a project using native-image-maven-plugin from GraalVM. I don't want to install native-image-tool, and I receiving the following error: Image building on Java 11+ without native-image requires MAVEN_OPTS='--add-exports=java.base/jdk.internal.module=ALL-UNNAMED'

I've tried different ways to add these options but keep getting the same error. I would be grateful if someone could tell me how to add these options to the embedded Maven from Intellij.

Thanks in advance


Solution

  • I have the same error working from the command line on windows 10. The only way to get one step further was to definitively install the native-image extension with gu install native-image and then copy <GRAAVM_HOME>\lib\svm\bin\native-image.exe to <GRAAVM_HOME>\bin as suggested here: https://github.com/oracle/graal/issues/2151#issuecomment-647522072