< prev index next >

src/java.base/share/classes/java/lang/VersionProps.java.template

Print this page
rev 48062 : 8192833: JEP 322: Time-Based Release Versioning

*** 30,46 **** import java.util.List; import java.util.Optional; class VersionProps { - private static final String launcher_name = "@@LAUNCHER_NAME@@"; private static final String java_version = "@@VERSION_SHORT@@"; private static final String java_runtime_name = "@@RUNTIME_NAME@@"; private static final String java_runtime_version = "@@VERSION_STRING@@"; --- 30,48 ---- import java.util.List; import java.util.Optional; 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@@"; private static final String java_runtime_version = "@@VERSION_STRING@@";
*** 55,72 **** --- 57,87 ---- "@@VERSION_PRE@@"; 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) { if (index - prevIndex > 1 && Character.digit(version.charAt(prevIndex), 10) <= 0)
*** 160,192 **** isHeadless = true; } /* First line: platform version. */ if (err) { ! ps.println(launcher_name + " version \"" + java_version + "\""); } else { /* Use a format more in line with GNU conventions */ ! ps.println(launcher_name + " " + java_version); } /* 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)) { jdk_debug_level = ""; } else { jdk_debug_level = jdk_debug_level + " "; } ! ps.print(java_runtime_name + " (" + jdk_debug_level + "build " + java_runtime_version); ! ! ps.println(')'); /* 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 + ")"); } } --- 175,212 ---- isHeadless = true; } /* First line: platform version. */ if (err) { ! 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 ! + " " + java_version_date ! + (isLTS ? " LTS" : "")); } /* Second line: runtime version (ie, libraries). */ String jdk_debug_level = System.getProperty("jdk.debug", "release"); if ("release".equals(jdk_debug_level)) { + /* Do not show debug level "release" builds */ jdk_debug_level = ""; } else { jdk_debug_level = jdk_debug_level + " "; } ! 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 + vendor_version ! + " (" + jdk_debug_level + "build " + java_vm_version + ", " ! + java_vm_info + ")"); ! } }
< prev index next >