Browse Source

don't depend on jre being lowercase, PR: 25798

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276376 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 21 years ago
parent
commit
88039803e6
2 changed files with 5 additions and 1 deletions
  1. +3
    -0
      WHATSNEW
  2. +2
    -1
      src/main/org/apache/tools/ant/launch/Locator.java

+ 3
- 0
WHATSNEW View File

@@ -122,6 +122,9 @@ Fixed bugs:
* AntClassLoader#getResource could return invalid URLs. Bugzilla * AntClassLoader#getResource could return invalid URLs. Bugzilla
Report 28060. Report 28060.


* Ant failed to locate tools.jar if the jre directory name wasn't all
lowercase. Bugzilla Report 25798.

Other changes: Other changes:
-------------- --------------




+ 2
- 1
src/main/org/apache/tools/ant/launch/Locator.java View File

@@ -23,6 +23,7 @@ import java.io.File;
import java.io.FilenameFilter; import java.io.FilenameFilter;
import java.text.CharacterIterator; import java.text.CharacterIterator;
import java.text.StringCharacterIterator; import java.text.StringCharacterIterator;
import java.util.Locale;


/** /**
* The Locator is a utility class which is used to find certain items * The Locator is a utility class which is used to find certain items
@@ -181,7 +182,7 @@ public final class Locator {
// couldn't find compiler - try to find tools.jar // couldn't find compiler - try to find tools.jar
// based on java.home setting // based on java.home setting
String javaHome = System.getProperty("java.home"); String javaHome = System.getProperty("java.home");
if (javaHome.endsWith("jre")) {
if (javaHome.toLowerCase(Locale.US).endsWith("jre")) {
javaHome = javaHome.substring(0, javaHome.length() - 4); javaHome = javaHome.substring(0, javaHome.length() - 4);
} }
File toolsJar = new File(javaHome + "/lib/tools.jar"); File toolsJar = new File(javaHome + "/lib/tools.jar");


Loading…
Cancel
Save