|
|
@@ -94,6 +94,9 @@ public final class JavaEnvUtils { |
|
|
|
/** Whether this is the GNU VM (gcj/gij) */ |
|
|
|
private static boolean gijDetected; |
|
|
|
|
|
|
|
/** Whether this is Apache Harmony */ |
|
|
|
private static boolean harmonyDetected; |
|
|
|
|
|
|
|
/** array of packages in the runtime */ |
|
|
|
private static Vector jrePackages; |
|
|
|
|
|
|
@@ -147,6 +150,13 @@ public final class JavaEnvUtils { |
|
|
|
} catch (Throwable t) { |
|
|
|
// swallow as this simply doesn't seem to be gcj/gij |
|
|
|
} |
|
|
|
harmonyDetected = false; |
|
|
|
try { |
|
|
|
Class.forName("org.apache.harmony.luni.util.Base64"); |
|
|
|
harmonyDetected = true; |
|
|
|
} catch (Throwable t) { |
|
|
|
// swallow as this simply doesn't seem to be Apache Harmony |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -217,6 +227,15 @@ public final class JavaEnvUtils { |
|
|
|
return gijDetected; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Checks whether the current VM is Apache Harmony. |
|
|
|
* @since Ant 1.8.2 |
|
|
|
* @return true if the current VM is Apache Harmony. |
|
|
|
*/ |
|
|
|
public static boolean isApacheHarmony() { |
|
|
|
return harmonyDetected; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Finds an executable that is part of a JRE installation based on |
|
|
|
* the java.home system property. |
|
|
|