--- a/src/java.base/share/classes/java/lang/VersionProps.java.template Wed Dec 13 17:29:44 2017 -0800
+++ b/src/java.base/share/classes/java/lang/VersionProps.java.template Wed Dec 13 17:28:24 2017 -0800
@@ -32,13 +32,15 @@
class VersionProps {
-
private static final String launcher_name =
"@@LAUNCHER_NAME@@";
private static final String java_version =
"@@VERSION_SHORT@@";
+ private static final String java_version_date =
+ "@@VERSION_DATE@@";
+
private static final String java_runtime_name =
"@@RUNTIME_NAME@@";
@@ -57,14 +59,27 @@
private static final String VERSION_OPT =
"@@VERSION_OPT@@";
+ private static final boolean isLTS =
+ "@@VERSION_OPT@@".startsWith("LTS");
+
+ private static final String VENDOR_VERSION_STRING =
+ "@@VENDOR_VERSION_STRING@@";
+
+ private static final String vendor_version =
+ (VENDOR_VERSION_STRING.length() > 0
+ ? " " + VENDOR_VERSION_STRING : "");
+
static {
init();
}
public static void init() {
System.setProperty("java.version", java_version);
+ System.setProperty("java.version.date", java_version_date);
System.setProperty("java.runtime.version", java_runtime_version);
System.setProperty("java.runtime.name", java_runtime_name);
+ if (VENDOR_VERSION_STRING.length() > 0)
+ System.setProperty("java.vendor.version", VENDOR_VERSION_STRING);
}
private static int parseVersionNumber(String version, int prevIndex, int index) {
@@ -162,31 +177,36 @@
/* First line: platform version. */
if (err) {
- ps.println(launcher_name + " version \"" + java_version + "\"");
+ ps.println(launcher_name + " version \"" + java_version + "\""
+ + " " + java_version_date
+ + (isLTS ? " LTS" : ""));
} else {
/* Use a format more in line with GNU conventions */
- ps.println(launcher_name + " " + java_version);
+ ps.println(launcher_name + " " + java_version
+ + " " + java_version_date
+ + (isLTS ? " LTS" : ""));
}
/* Second line: runtime version (ie, libraries). */
String jdk_debug_level = System.getProperty("jdk.debug", "release");
- /* Debug level is not printed for "release" builds */
if ("release".equals(jdk_debug_level)) {
+ /* Do not show debug level "release" builds */
jdk_debug_level = "";
} else {
jdk_debug_level = jdk_debug_level + " ";
}
- ps.print(java_runtime_name + " (" + jdk_debug_level + "build " + java_runtime_version);
-
- ps.println(')');
+ ps.println(java_runtime_name + vendor_version
+ + " (" + jdk_debug_level + "build " + java_runtime_version + ")");
/* Third line: JVM information. */
String java_vm_name = System.getProperty("java.vm.name");
String java_vm_version = System.getProperty("java.vm.version");
String java_vm_info = System.getProperty("java.vm.info");
- ps.println(java_vm_name + " (" + jdk_debug_level + "build " + java_vm_version + ", " +
- java_vm_info + ")");
+ ps.println(java_vm_name + vendor_version
+ + " (" + jdk_debug_level + "build " + java_vm_version + ", "
+ + java_vm_info + ")");
+
}
}