|
@@ -101,6 +101,10 @@ public final class JavaEnvUtils { |
|
|
|
|
|
|
|
|
/** Whether this is the Kaffe VM */ |
|
|
/** Whether this is the Kaffe VM */ |
|
|
private static boolean kaffeDetected; |
|
|
private static boolean kaffeDetected; |
|
|
|
|
|
|
|
|
|
|
|
/** Wheter this is a GNU Classpath based VM */ |
|
|
|
|
|
private static boolean classpathDetected; |
|
|
|
|
|
|
|
|
/** Whether this is the GNU VM (gcj/gij) */ |
|
|
/** Whether this is the GNU VM (gcj/gij) */ |
|
|
private static boolean gijDetected; |
|
|
private static boolean gijDetected; |
|
|
|
|
|
|
|
@@ -159,6 +163,13 @@ public final class JavaEnvUtils { |
|
|
} catch (Throwable t) { |
|
|
} catch (Throwable t) { |
|
|
// swallow as this simply doesn't seem to be Kaffe |
|
|
// swallow as this simply doesn't seem to be Kaffe |
|
|
} |
|
|
} |
|
|
|
|
|
classpathDetected = false; |
|
|
|
|
|
try { |
|
|
|
|
|
Class.forName("gnu.classpath.Configuration"); |
|
|
|
|
|
classpathDetected = true; |
|
|
|
|
|
} catch (Throwable t) { |
|
|
|
|
|
// swallow as this simply doesn't seem to be GNU classpath based. |
|
|
|
|
|
} |
|
|
gijDetected = false; |
|
|
gijDetected = false; |
|
|
try { |
|
|
try { |
|
|
Class.forName("gnu.gcj.Core"); |
|
|
Class.forName("gnu.gcj.Core"); |
|
@@ -233,6 +244,15 @@ public final class JavaEnvUtils { |
|
|
return kaffeDetected; |
|
|
return kaffeDetected; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Checks whether the current Java VM is GNU Classpath |
|
|
|
|
|
* @since Ant 1.9.1 |
|
|
|
|
|
* @return true if the version of Java is GNU Classpath |
|
|
|
|
|
*/ |
|
|
|
|
|
public static boolean isClasspathBased() { |
|
|
|
|
|
return classpathDetected; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Checks whether the current Java VM is the GNU interpreter gij |
|
|
* Checks whether the current Java VM is the GNU interpreter gij |
|
|
* or we are running in a gcj precompiled binary. |
|
|
* or we are running in a gcj precompiled binary. |
|
|