X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2Futil%2FPlatform.java;h=55fe2f1877025b7baff399b69574feb8b48b9a05;hb=7a9bc0ba0fd215bd5b9a2e370937d81870aadba5;hp=ed5962734cb285cc678fc6ab399d5041250aa44e;hpb=103c9465744d35d6ade7c0520a5faa2c6375e7b2;p=nestedvm.git 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); }