Browse Source

Add the correct path to the runtime library on MacOS X in <javac> and <rmic>.

Based on patch submitted by:	Otto Moerbeek <omoerbeek@mac.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269356 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
5e097248de
2 changed files with 30 additions and 0 deletions
  1. +15
    -0
      src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  2. +15
    -0
      src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java

+ 15
- 0
src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java View File

@@ -152,6 +152,9 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {
}

if (includeJavaRuntime) {
// XXX move this stuff to a separate class, code is identical to
// code in ../rmic/DefaultRmicAdapter

if (System.getProperty("java.vendor").toLowerCase().indexOf("microsoft") >= 0) {
// Pull in *.zip from packages directory
FileSet msZipFiles = new FileSet();
@@ -178,6 +181,18 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter {
+ File.separator +"jre"
+ File.separator + "lib"
+ File.separator + "rt.jar"));

// Added for MacOS X
classpath.addExisting(new Path(null,
System.getProperty("java.home")
+ File.separator + ".."
+ File.separator + "Classes"
+ File.separator + "classes.jar"));
classpath.addExisting(new Path(null,
System.getProperty("java.home")
+ File.separator + ".."
+ File.separator + "Classes"
+ File.separator + "ui.jar"));
}
}


+ 15
- 0
src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java View File

@@ -143,6 +143,9 @@ public abstract class DefaultRmicAdapter implements RmicAdapter {
}

if (attributes.getIncludejavaruntime()) {
// XXX move this stuff to a separate class, code is identical to
// code in ../compiler/DefaultCompilerAdapter

if (System.getProperty("java.vendor").toLowerCase().indexOf("microsoft") >= 0) {
// Pull in *.zip from packages directory
FileSet msZipFiles = new FileSet();
@@ -176,6 +179,18 @@ public abstract class DefaultRmicAdapter implements RmicAdapter {
+ File.separator +"jre"
+ File.separator + "lib"
+ File.separator + "rt.jar"));

// Added for MacOS X
classpath.addExisting(new Path(null,
System.getProperty("java.home")
+ File.separator + ".."
+ File.separator + "Classes"
+ File.separator + "classes.jar"));
classpath.addExisting(new Path(null,
System.getProperty("java.home")
+ File.separator + ".."
+ File.separator + "Classes"
+ File.separator + "ui.jar"));
}
}
return classpath;


Loading…
Cancel
Save