OPENJPA-2036: Check JAVA_HOME for lib/tools.jar for all java vendors, not just IBM.

Submitted By: Jason Pyeron

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1151885 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Dick 2011-07-28 15:03:04 +00:00
parent 868035a540
commit 4412599698
1 changed files with 8 additions and 10 deletions

View File

@ -191,16 +191,14 @@ public class InstrumentationFactory {
if (log.isTraceEnabled() == true) {
log.trace(_name + ".findToolsJar() -- couldn't find default " + toolsJarFile.getAbsolutePath());
}
if (JavaVendors.getCurrentVendor().isIBM()) {
// If we're on an IBM SDK, then remove /jre off of java.home and try again.
if (javaHomeFile.getAbsolutePath().endsWith(File.separator + "jre") == true) {
javaHomeFile = javaHomeFile.getParentFile();
toolsJarFile = new File(javaHomeFile, "lib" + File.separator + "tools.jar");
if (toolsJarFile.exists() == false) {
if (log.isTraceEnabled() == true) {
log.trace(_name + ".findToolsJar() -- for IBM SDK couldn't find " +
toolsJarFile.getAbsolutePath());
}
// If we're on an IBM SDK, then remove /jre off of java.home and try again.
if (javaHomeFile.getAbsolutePath().endsWith(File.separator + "jre") == true) {
javaHomeFile = javaHomeFile.getParentFile();
toolsJarFile = new File(javaHomeFile, "lib" + File.separator + "tools.jar");
if (toolsJarFile.exists() == false) {
if (log.isTraceEnabled() == true) {
log.trace(_name + ".findToolsJar() -- for IBM SDK couldn't find " +
toolsJarFile.getAbsolutePath());
}
}
} else if (System.getProperty("os.name").toLowerCase().indexOf("mac") >= 0) {