Here's a commit upgrading a project from GraalVM java8 (19.3.0) to java11 (20.1.0), if anyone's interested: https://github.com/borkdude/clj-kondo/commit/e1b9df02204c4bc655c7fdbc8e6481dce94de9b9
If I wrote some notes about https://www.graalvm.org/sdk/javadoc/org/graalvm/nativeimage/ImageInfo.html , would that be useful enough to include in https://github.com/lread/clj-graal-docs#tips-and-tricks ?
@smith.adriane Sure. Note that you can also use system properties set by GraalVM to determine if you're running inside a native image.
$ bb '(clojure.pprint/pprint (into {} (System/getProperties)))'
{"org.graalvm.nativeimage.kind" "executable",
"java.vm.specification.vendor" "Oracle Corporation",
"java.vendor.url" "<https://www.graalvm.org/>",
"java.specification.name" "Java Platform API Specification",
"line.separator" "\n",
"java.vm.version" "GraalVM 20.1.0 Java 11",
"java.vendor" "Oracle Corporation",
"java.specification.vendor" "Oracle Corporation",
"java.vm.specification.version" "11",
"java.vm.vendor" "Oracle Corporation",
"org.graalvm.nativeimage.imagecode" "runtime",
"java.vm.name" "Substrate VM",
"java.version" "11.0.7",
"java.specification.version" "11",
"java.class.version" "55.0",
"jdk.lang.Process.launchMechanism" "FORK",
"java.vm.specification.name" "Java Virtual Machine Specification"}
e.g. note "org.graalvm.nativeimage.kind" "executable"
it's even referenced in the source, https://github.com/oracle/graal/blob/master/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/ImageInfo.java
nice! didn't know
I'll make sure to include the system properties in the notes
thanks!
I the tip would have helped you, then it will probably help others.
Thanks for contributing!
thanks for managing all the docs. graalvm is magic 🧙
It is a community effort, I just started the repo and it took off (with lots of heavy lifting from @borkdude!).