X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2Futil%2FPlatform.java;h=55fe2f1877025b7baff399b69574feb8b48b9a05;hp=ed5962734cb285cc678fc6ab399d5041250aa44e;hb=095d6d46361db8b4b69790305c0310ea114d3813;hpb=b7956688249a89b71e4873cdff862631e4b3704a diff --git a/src/org/ibex/nestedvm/util/Platform.java b/src/org/ibex/nestedvm/util/Platform.java index ed59627..55fe2f1 100644 --- a/src/org/ibex/nestedvm/util/Platform.java +++ b/src/org/ibex/nestedvm/util/Platform.java @@ -13,7 +13,10 @@ public abstract class Platform { static { float version; try { - version = Float.valueOf(System.getProperty("java.specification.version")).floatValue(); + if(getProperty("java.vm.name").equals("SableVM")) + version = 1.2f; + else + version = Float.valueOf(getProperty("java.specification.version")).floatValue(); } catch(Exception e) { System.err.println("WARNING: " + e + " while trying to find jvm version - assuming 1.1"); version = 1.1f; @@ -33,6 +36,15 @@ public abstract class Platform { } } + public static String getProperty(String key) { + try { + return System.getProperty(key); + } catch(SecurityException e) { + return null; + } + } + + abstract boolean _atomicCreateFile(File f) throws IOException; public static boolean atomicCreateFile(File f) throws IOException { return p._atomicCreateFile(f); }