diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java index 32929f758b2d..db171960ddbc 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java @@ -81,7 +81,12 @@ public boolean consume(ArgumentQueue args) { case "--version": args.poll(); singleArgumentCheck(args, headArg); - String message = System.getProperty("java.vm.version"); + String message; + if (NativeImage.IS_AOT) { + message = System.getProperty("java.vm.version"); + } else { + message = "native-image " + NativeImage.graalvmVersion + " " + NativeImage.graalvmConfig; + } message += " (Java Version " + javaRuntimeVersion + ")"; nativeImage.showMessage(message); System.exit(0); diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java index 9956e800cf33..d3752492347b 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java @@ -112,6 +112,7 @@ private static String getPlatform() { } static final String graalvmVersion = System.getProperty("org.graalvm.version", "dev"); + static final String graalvmConfig = System.getProperty("org.graalvm.config", "CE"); private static Map getCompilerFlags() { Map result = new HashMap<>(); @@ -813,6 +814,7 @@ private void prepareImageBuildArgs() { addImageBuilderJavaArgs("-Djava.awt.headless=true"); } addImageBuilderJavaArgs("-Dorg.graalvm.version=" + graalvmVersion); + addImageBuilderJavaArgs("-Dorg.graalvm.config=" + graalvmConfig); addImageBuilderJavaArgs("-Dcom.oracle.graalvm.isaot=true"); addImageBuilderJavaArgs("-Djava.system.class.loader=" + CUSTOM_SYSTEM_CLASS_LOADER); diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/VMFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/VMFeature.java index 9f2d38d89a41..d2e928088a14 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/VMFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/VMFeature.java @@ -58,7 +58,8 @@ public void afterRegistration(AfterRegistrationAccess access) { } protected VM createVMSingletonValue() { - return new VM("CE"); + String config = System.getProperty("org.graalvm.config", "CE"); + return new VM(config); } @Override