You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2006/04/06 21:00:31 UTC
svn commit: r392037 - in /ant/core/trunk: contributors.xml
src/main/org/apache/tools/ant/launch/Locator.java
Author: bodewig
Date: Thu Apr 6 12:00:30 2006
New Revision: 392037
URL: http://svn.apache.org/viewcvs?rev=392037&view=rev
Log:
find tools.jar even if it is distributed with the JRE, submitted by Nick Crossley, PR 38500
Modified:
ant/core/trunk/contributors.xml
ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
Modified: ant/core/trunk/contributors.xml
URL: http://svn.apache.org/viewcvs/ant/core/trunk/contributors.xml?rev=392037&r1=392036&r2=392037&view=diff
==============================================================================
--- ant/core/trunk/contributors.xml (original)
+++ ant/core/trunk/contributors.xml Thu Apr 6 12:00:30 2006
@@ -668,6 +668,10 @@
</name>
<name>
<first>Nick</first>
+ <last>Crossley</last>
+ </name>
+ <name>
+ <first>Nick</first>
<last>Fortescue</last>
</name>
<name>
Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?rev=392037&r1=392036&r2=392037&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java Thu Apr 6 12:00:30 2006
@@ -339,10 +339,15 @@
// couldn't find compiler - try to find tools.jar
// based on java.home setting
String javaHome = System.getProperty("java.home");
+ File toolsJar = new File(javaHome + "/lib/tools.jar");
+ if (toolsJar.exists()) {
+ // Found in java.home as given
+ return toolsJar;
+ }
if (javaHome.toLowerCase(Locale.US).endsWith(File.separator + "jre")) {
javaHome = javaHome.substring(0, javaHome.length() - 4);
+ toolsJar = new File(javaHome + "/lib/tools.jar");
}
- File toolsJar = new File(javaHome + "/lib/tools.jar");
if (!toolsJar.exists()) {
System.out.println("Unable to locate tools.jar. "
+ "Expected to find it in " + toolsJar.getPath());
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org