create native-image and Truffle in graalvm

141 Views Asked by At

I used js in my Java program and when I want to get native-imag output from this program I am in trouble this error:

Caused by: com.oracle.svm.driver.NativeImage$NativeImageError: Unknown name in option specification: macro:truffle-svm

Available macro options are: --macro:gu-launcher --macro:jsvm-library --macro:native-image-agent-library --macro:native-image-configure-launcher --macro:native-image-diagnostics-agent-library --macro:native-image-launcher --macro:polyglot-launcher --macro:polyglot-library --macro:truffle --macro:truffle-language-library

I expected native-image to be created without any problems because I had introduced the dynamic features of Java and there was no problem in terms of the agent.

1

There are 1 best solutions below

0
Steves On

It would be useful if you provided more details: GraalVM version that you are using, how you invoke native-image (using the official Maven plugin, handwritten command line, what are the options, ...).

I am going to guess that you're using GraalVM 23.1 and you see this error because you did not update Truffle or Truffle languages dependencies or you did not update the GraalVM native-image Maven plugin. A lot has changed in 23.1: most notable Truffle and Truffle languages can and should be treated just like any other Java libraries pulled from Maven - there is no need for special native-image options. See more details in:

https://medium.com/graalvm/truffle-unchained-13887b77b62c