IBM's JDK 1.2 as well. @todo refactor into a single method somewhere PR: 5541 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270667 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1,7 +1,7 @@ | |||
/* | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2000-2001 The Apache Software Foundation. All rights | |||
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
@@ -680,14 +680,25 @@ public class Javac extends MatchingTask { | |||
// nothing for *nix. | |||
String extension = Os.isFamily("dos") ? ".exe" : ""; | |||
// Look for java in the java.home/../bin directory. Unfortunately | |||
File jExecutable = null; | |||
// On AIX using IBM's JDK 1.2 the javac executable is in | |||
// the java.home/../../sh directory | |||
if (Os.isName("aix")) { | |||
jExecutable = new File(System.getProperty("java.home") + | |||
"/../../sh/javac" + extension); | |||
} | |||
if (jExecutable == null || !jExecutable.exists()) { | |||
// Look for javac in the java.home/../bin directory. | |||
jExecutable = new File(System.getProperty("java.home") + | |||
"/../bin/javac" + extension); | |||
} | |||
// Unfortunately | |||
// on Windows java.home doesn't always refer to the correct location, | |||
// so we need to fall back to assuming java is somewhere on the | |||
// PATH. | |||
java.io.File jExecutable = | |||
new java.io.File(System.getProperty("java.home") + | |||
"/../bin/javac" + extension ); | |||
if (jExecutable.exists() && !Os.isFamily("netware")) { | |||
return jExecutable.getAbsolutePath(); | |||
} else { | |||
@@ -1,7 +1,7 @@ | |||
/* | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2000-2001 The Apache Software Foundation. All rights | |||
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
@@ -1161,19 +1161,29 @@ public class Javadoc extends Task { | |||
// nothing for *nix. | |||
String extension = Os.isFamily("dos") ? ".exe" : ""; | |||
// Look for javadoc in the java.home/../bin directory. Unfortunately | |||
// on Windows java.home doesn't always refer to the correct location, | |||
// so we need to fall back to assuming javadoc is somewhere on the | |||
File jdocExecutable = null; | |||
// On AIX using IBM's JDK 1.2 the javadoc executable is in | |||
// the java.home/../sh directory | |||
if (Os.isName("aix")) { | |||
jdocExecutable = new File(System.getProperty("java.home") + | |||
"/../sh/javadoc" + extension); | |||
} | |||
if (jdocExecutable == null || !jdocExecutable.exists()) { | |||
// Look for javadoc in the java.home/../bin directory. | |||
jdocExecutable = new File(System.getProperty("java.home") + | |||
"/../bin/javadoc" + extension); | |||
} | |||
// Unfortunately | |||
// on Windows java.home doesn't always refer to the correct location, | |||
// so we need to fall back to assuming java is somewhere on the | |||
// PATH. | |||
File jdocExecutable = new File( System.getProperty("java.home") + | |||
"/../bin/javadoc" + extension ); | |||
if (jdocExecutable.exists() && !Os.isFamily("netware")) | |||
{ | |||
if (jdocExecutable.exists() && !Os.isFamily("netware")) { | |||
return jdocExecutable.getAbsolutePath(); | |||
} | |||
else | |||
{ | |||
} else { | |||
if (!Os.isFamily("netware")) { | |||
log( "Unable to locate " + jdocExecutable.getAbsolutePath() + | |||
". Using \"javadoc\" instead.", Project.MSG_VERBOSE ); | |||
@@ -1,7 +1,7 @@ | |||
/* | |||
* The Apache Software License, Version 1.1 | |||
* | |||
* Copyright (c) 2000-2001 The Apache Software Foundation. All rights | |||
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights | |||
* reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
@@ -54,6 +54,7 @@ | |||
package org.apache.tools.ant.types; | |||
import java.io.File; | |||
import java.util.Properties; | |||
import java.util.Enumeration; | |||
import java.util.Vector; | |||
@@ -352,13 +353,25 @@ public class CommandlineJava implements Cloneable { | |||
// nothing for *nix. | |||
String extension = Os.isFamily("dos") ? ".exe" : ""; | |||
// Look for java in the java.home/../bin directory. Unfortunately | |||
File jExecutable = null; | |||
// On AIX using IBM's JDK 1.2 the java executable is in | |||
// the java.home/../sh directory | |||
if (Os.isName("aix")) { | |||
jExecutable = new File(System.getProperty("java.home") + | |||
"/../sh/java" + extension); | |||
} | |||
if (jExecutable == null || !jExecutable.exists()) { | |||
// Look for java in the java.home/../bin directory. | |||
jExecutable = new File(System.getProperty("java.home") + | |||
"/../bin/java" + extension); | |||
} | |||
// Unfortunately | |||
// on Windows java.home doesn't always refer to the correct location, | |||
// so we need to fall back to assuming java is somewhere on the | |||
// PATH. | |||
java.io.File jExecutable = | |||
new java.io.File(System.getProperty("java.home") + | |||
"/../bin/java" + extension ); | |||
if (jExecutable.exists() && !Os.isFamily("netware")) { | |||
// NetWare may have a "java" in that directory, but 99% of | |||