diff options
author | Michael Bien <[email protected]> | 2010-11-18 01:38:42 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-11-18 01:38:42 +0100 |
commit | 1e0288b397dfd914532c0f0cde850f4e5c5bc91d (patch) | |
tree | 966939bd5c6dca6f5910f4e91435710e248ea912 /src/java/com/jogamp/common/os | |
parent | deedd4f67b19919d4a231224bfa6a7edbd36e608 (diff) |
Version info debugging works now even without native libs.
- Platform is now useable without gluegen-rt libs in library path.
- JogampVersion: fixed equals, added Impl url to manifest.
- VersionUtil: getManifest should be now more relieable and passed all manual tests, e.g java jar lib.jar without specified classpath.
Diffstat (limited to 'src/java/com/jogamp/common/os')
-rw-r--r-- | src/java/com/jogamp/common/os/Platform.java | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/src/java/com/jogamp/common/os/Platform.java b/src/java/com/jogamp/common/os/Platform.java index aac72af..c6075e3 100644 --- a/src/java/com/jogamp/common/os/Platform.java +++ b/src/java/com/jogamp/common/os/Platform.java @@ -59,8 +59,7 @@ public class Platform { private static final int pointerSizeInBits; static { - NativeLibrary.ensureNativeLibLoaded(); - + // We don't seem to need an AccessController.doPrivileged() block // here as these system properties are visible even to unsigned // applets @@ -72,16 +71,29 @@ public class Platform { JAVA_VERSION = System.getProperty("java.version"); NEWLINE = System.getProperty("line.separator"); - pointerSizeInBits = getPointerSizeInBitsImpl(); - is32Bit = initArch(); JAVA_SE = initIsJavaSE(); LITTLE_ENDIAN = initByteOrder(); + + boolean libsLoaded = true; + try{ + NativeLibrary.ensureNativeLibLoaded(); + }catch (UnsatisfiedLinkError err){ + libsLoaded = false; + } + + if(libsLoaded) { + pointerSizeInBits = getPointerSizeInBitsImpl(); + }else{ + pointerSizeInBits = -1; + } + + is32Bit = initArch(); + } private Platform() {} private static boolean initArch() throws RuntimeException { - // Try to use Sun's sun.ARCH.data.model first .. if ( 32 == pointerSizeInBits || 64 == pointerSizeInBits ) { return 32 == pointerSizeInBits; }else { @@ -188,28 +200,28 @@ public class Platform { } /** - * Returns the JAVA vendor + * Returns the JAVA. */ public static String getJavaVendor() { return JAVA_VENDOR; } /** - * Returns the JAVA vendor url + * Returns the JAVA vendor url. */ public static String getJavaVendorURL() { return JAVA_VENDOR_URL; } /** - * Returns the JAVA vendor + * Returns the JAVA vendor. */ public static String getJavaVersion() { return JAVA_VERSION; } /** - * Returns the JAVA vendor + * Returns the JAVA vendor. */ public static String getNewline() { return NEWLINE; @@ -222,6 +234,13 @@ public class Platform { return is32Bit; } + /** + * Returns true if this JVM is a 64bit JVM. + */ + public static boolean is64Bit() { + return !is32Bit; + } + public static int getPointerSizeInBits() { return pointerSizeInBits; } |