Our com.sun.tools.javac.Main wrapper fails in the majority of cases (e.g. via Ant) because of a lack of a bootclasspath. With this patch I can build code via ant using this wrapper.
Changelog: 2007-10-12 Andrew John Hughes <[EMAIL PROTECTED]> PR classpath/33385: * tools/com/sun/tools/javac/Main.java: Add bootclasspath and 1.5 options so the compiler can run. -- Andrew :-) Escape the Java Trap with GNU Classpath! http://www.gnu.org/philosophy/java-trap.html public class gcj extends Freedom implements Java { ... }
Index: tools/com/sun/tools/javac/Main.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/com/sun/tools/javac/Main.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 Main.java --- tools/com/sun/tools/javac/Main.java 1 Mar 2007 00:26:09 -0000 1.1 +++ tools/com/sun/tools/javac/Main.java 13 Oct 2007 08:19:20 -0000 @@ -139,8 +139,13 @@ public class Main new PrintWriter(System.err), Boolean.FALSE }); + String[] runArgs = new String[args.length + 3]; + runArgs[0] = "-1.5"; + runArgs[1] = "-bootclasspath"; + runArgs[2] = (String) System.getProperties().get("java.boot.class.path"); + System.arraycopy(args, 0, runArgs, 3, args.length); return ((Boolean) ecjMethod.invoke(ecjInstance, new Object[] - { args })).booleanValue() ? 0 : -1; + { runArgs })).booleanValue() ? 0 : -1; } public static int compile(String[] args) throws Exception
signature.asc
Description: Digital signature