summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-22 07:48:45 +0200
committerSven Gothel <[email protected]>2013-09-22 07:48:45 +0200
commit03d17baf99d3bcb0c0650f80e24d7813544d21fa (patch)
tree1587765d35fcc7e3157d889999f3c833731dddd7 /src
parent4fbc50cb299e2e9334ebbfabc6ebe32718130b6b (diff)
Bug 816: Add Platform.JAVA_VERSION_UPDATE - Allowing to determin whether JVM is >= 1.7.0u40
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/common/util/VersionUtil.java2
-rw-r--r--src/java/jogamp/common/os/PlatformPropsImpl.java15
2 files changed, 16 insertions, 1 deletions
diff --git a/src/java/com/jogamp/common/util/VersionUtil.java b/src/java/com/jogamp/common/util/VersionUtil.java
index 8d9e6a9..51373eb 100644
--- a/src/java/com/jogamp/common/util/VersionUtil.java
+++ b/src/java/com/jogamp/common/util/VersionUtil.java
@@ -68,7 +68,7 @@ public class VersionUtil {
Platform.getMachineDescription().toString(sb).append(Platform.getNewline());
// JVM/JRE
- sb.append("Platform: Java Version: ").append(Platform.getJavaVersion()).append(", VM: ").append(Platform.getJavaVMName());
+ sb.append("Platform: Java Version: ").append(Platform.getJavaVersion()).append(" (").append(Platform.getJavaVersionNumber()).append("u").append(Platform.JAVA_VERSION_UPDATE).append("), VM: ").append(Platform.getJavaVMName());
sb.append(", Runtime: ").append(Platform.getJavaRuntimeName()).append(Platform.getNewline());
sb.append("Platform: Java Vendor: ").append(Platform.getJavaVendor()).append(", ").append(Platform.getJavaVendorURL());
sb.append(", JavaSE: ").append(Platform.isJavaSE());
diff --git a/src/java/jogamp/common/os/PlatformPropsImpl.java b/src/java/jogamp/common/os/PlatformPropsImpl.java
index 6089cc2..819fe9c 100644
--- a/src/java/jogamp/common/os/PlatformPropsImpl.java
+++ b/src/java/jogamp/common/os/PlatformPropsImpl.java
@@ -44,6 +44,8 @@ public abstract class PlatformPropsImpl {
/** Version 1.6. As a JVM version, it enables certain JVM 1. features. */
public static final VersionNumber Version16;
+ /** Version 1.7. As a JVM version, it enables certain JVM 1.7 features. */
+ public static final VersionNumber Version17;
public static final String OS;
public static final String OS_lower;
@@ -55,6 +57,7 @@ public abstract class PlatformPropsImpl {
public static final String JAVA_VENDOR_URL;
public static final String JAVA_VERSION;
public static final VersionNumber JAVA_VERSION_NUMBER;
+ public static final int JAVA_VERSION_UPDATE;
public static final String JAVA_VM_NAME;
public static final String JAVA_RUNTIME_NAME;
/** True if having {@link java.nio.LongBuffer} and {@link java.nio.DoubleBuffer} available. */
@@ -72,6 +75,7 @@ public abstract class PlatformPropsImpl {
static {
Version16 = new VersionNumber(1, 6, 0);
+ Version17 = new VersionNumber(1, 7, 0);
// We don't seem to need an AccessController.doPrivileged() block
// here as these system properties are visible even to unsigned Applets.
OS = System.getProperty("os.name");
@@ -84,6 +88,17 @@ public abstract class PlatformPropsImpl {
JAVA_VENDOR_URL = System.getProperty("java.vendor.url");
JAVA_VERSION = System.getProperty("java.version");
JAVA_VERSION_NUMBER = new VersionNumber(JAVA_VERSION);
+ {
+ final int usIdx = JAVA_VERSION.lastIndexOf("_");
+ int jvmUpdate = 0;
+ if( usIdx > 0 ) {
+ final String buildS = Platform.JAVA_VERSION.substring(usIdx+1);
+ try {
+ jvmUpdate = Integer.valueOf(buildS);
+ } catch (NumberFormatException nfe) {}
+ }
+ JAVA_VERSION_UPDATE = jvmUpdate;
+ }
JAVA_VM_NAME = System.getProperty("java.vm.name");
JAVA_RUNTIME_NAME = getJavaRuntimeNameImpl();
JAVA_SE = initIsJavaSE();