I wanted to check out the mx image generator:
./mx image -cp $PWD/svmbuild -H:Class=HelloWorld -H:Name=helloworld
mx: unknown command 'image'
It seems that the "image" command is not available (anymore?)
Any replacement available?
Thanks
I wanted to check out the mx image generator:
./mx image -cp $PWD/svmbuild -H:Class=HelloWorld -H:Name=helloworld
mx: unknown command 'image'
It seems that the "image" command is not available (anymore?)
Any replacement available?
Thanks
There's an mx native-image
command.
The README file in the GraalVM project repository lists the following quick start snippet:
cd substratevm
mx build
echo "public class HelloWorld { public static void main(String[] args) {
System.out.println(\"Hello World\"); } }" > HelloWorld.java
$JAVA_HOME/bin/javac HelloWorld.java
mx native-image HelloWorld
./helloworld
Allegedly, one needs a JDK 8 with the JVMCI for this to work, here's a relevant quote from the README:
Install mx and point JAVA_HOME to a labsjdk.
For compilation native-image depends on the local toolchain, so make sure: glibc-devel, zlib-devel (header files for the C library and zlib) and gcc are available on your system.