Browse Source

Use the correct path to the runtime classes in JDK > 1.1.

Submitted by:	Christopher Elkins <celkins@scardini.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267760 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
3007c59302
1 changed files with 28 additions and 11 deletions
  1. +28
    -11
      src/main/org/apache/tools/ant/taskdefs/Javac.java

+ 28
- 11
src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -140,7 +140,17 @@ public class Javac extends MatchingTask {
* @param srcDirName the name of the directory to add to the list of source directories.
*/
private void addSrcDir(String srcDirName) {
srcDirs.addElement(project.resolveFile(srcDirName));
addSrcDir(project.resolveFile(srcDirName));
}

/**
* Add a single directory to the collection of directories that
* make up the source path.
*
* @param srcDir the directory to add to the list of source directories.
*/
private void addSrcDir(File srcDir) {
srcDirs.addElement(srcDir);
}

/**
@@ -170,8 +180,8 @@ public class Javac extends MatchingTask {
* Set the destination directory into which the Java source
* files should be compiled.
*/
public void setDestdir(String destDirName) {
destDir = project.resolveFile(destDirName);
public void setDestdir(File destDir) {
this.destDir = destDir;
}

/**
@@ -200,22 +210,22 @@ public class Javac extends MatchingTask {
/**
* Set the deprecation flag.
*/
public void setDeprecation(String deprecationString) {
this.deprecation = Project.toBoolean(deprecationString);
public void setDeprecation(boolean deprecation) {
this.deprecation = deprecation;
}

/**
* Set the debug flag.
*/
public void setDebug(String debugString) {
this.debug = Project.toBoolean(debugString);
public void setDebug(boolean debug) {
this.debug = debug;
}

/**
* Set the optimize flag.
*/
public void setOptimize(String optimizeString) {
this.optimize = Project.toBoolean(optimizeString);
public void setOptimize(boolean optimize) {
this.optimize = optimize;
}

/**
@@ -229,8 +239,8 @@ public class Javac extends MatchingTask {
/**
* Set the filtering flag.
*/
public void setFiltering(String filter) {
filtering = Project.toBoolean(filter);
public void setFiltering(boolean filter) {
filtering = filter;
}

/**
@@ -402,6 +412,13 @@ public class Javac extends MatchingTask {
+ File.separator + "lib"
+ File.separator + "classes.zip");
} else {
// JDK > 1.1 seems to set java.home to the JRE directory.
addExistingToClasspath(classpath,
System.getProperty("java.home")
+ File.separator + "lib"
+ File.separator + "rt.jar");
// Just keep the old version as well and let addExistingToPath
// sort it out.
addExistingToClasspath(classpath,
System.getProperty("java.home")
+ File.separator +"jre"


Loading…
Cancel
Save