Skip to content
Snippets Groups Projects
Commit 0ec190c0 authored by Nadav Har'El's avatar Nadav Har'El Committed by Avi Kivity
Browse files

Add "-version" option to RunJava


Add "-version" option to RunJava, and therefore to java.so and the "java"
CLI command.

java -version now shows:

  java version "1.7.0_25"
  OpenJDK Runtime Environment (1.7.0_25-mockbuild_2013_07_27_13_36-b00)
  OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

I can't explain why the version on the second line is different than what
"java -version" on Fedora 18 shows for the same libjvm.so:

  java version "1.7.0_25"
  OpenJDK Runtime Environment (fedora-2.3.10.4.fc18-x86_64)
  OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
parent 61be0c33
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,16 @@ public class RunJava { ...@@ -56,6 +56,16 @@ public class RunJava {
String key = args[i].substring(2, eq); String key = args[i].substring(2, eq);
String value = args[i].substring(eq+1, args[i].length()); String value = args[i].substring(eq+1, args[i].length());
System.setProperty(key, value); System.setProperty(key, value);
} else if (args[i].equals("-version")) {
System.err.println("java version \"" +
System.getProperty("java.version") + "\"");
System.err.println(System.getProperty("java.runtime.name") +
" (" + System.getProperty("java.runtime.version") +
")");
System.err.println(System.getProperty("java.vm.name") +
" (build " + System.getProperty("java.vm.version") +
", " + System.getProperty("java.vm.info") + ")");
return;
} else if (!args[i].startsWith("-")) { } else if (!args[i].startsWith("-")) {
runClass(args[i], java.util.Arrays.copyOfRange(args, i+1, args.length), classpath); runClass(args[i], java.util.Arrays.copyOfRange(args, i+1, args.length), classpath);
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment