On Wednesday 17 October 2007 16:27:38 you wrote: > Andrew John Hughes writes: > > On Wednesday 17 October 2007 15:14:44 you wrote: > > > Andrew John Hughes writes: > > > > On Monday 15 October 2007 10:09:02 Andrew Haley wrote: > > > > > Andrew John Hughes writes: > > > > > > 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 <gnu_andrew@xxxxxxxxxxxxxx> > > > > > > > > > > > > PR classpath/33385: > > > > > > * tools/com/sun/tools/javac/Main.java: > > > > > > Add bootclasspath and 1.5 options so the compiler > > > > > > can run. > > > > > > > > > > Oddly, we've been building via Ant for years now, without needing > > > > > this patch. You're doing something wrong. > > > > > > > > Have you looked at the referenced bug? All I'm doing is running > > > > 'ant' which I assume should work. I've not seen this work since it > > > > went into Classpath in February, so perhaps something got broken > > > > then. I have to use these options to run ecj externally FWIW. > > > > > > Then something is wrong with your configuration. > > > > > > ecj uses System.getProperty("java.home") to find rt.jar. The most > > > likely cause of your problem is that you have not correctly set this > > > property. > > > > > > The code looks like this: > > > > > > if (bootclasspaths.size() == 0) { > > > > > > ... > > > > > > if (getJavaHome() != null) { > > > File[] directoriesToCheck = new File[] { > > > new File(getJavaHome(), "lib") //$NON-NLS-1$ > > > }; > > > File[][] systemLibrariesJars = > > > getLibrariesFiles(directoriesToCheck); if (systemLibrariesJars != > > > null) { > > > > So presumably JAVA_HOME should be set? > > No, you shouldn't have to set it yourself, although you may choose to > do so. Your Java VM should set the java.home system property to point > to your Java installation directory. If running ecj doesn't find > rt.jar it is a problem with your JRE's installation. > Right, but this can be meaningless in some cases e.g. cacao and jamvm may not be installed in the same place as the class library. It only really works when everything is predetermined by some overarching Java environment as with gcj. For example, with cacao and classpath, I have to manually put something together to emulate the JDK tree. > > rt.jar seems to be in jre/lib so the above would fail presumably. > > I don't understand why you say this. If rt.jar is in > <java.home>/jre/lib then it will succeed. > I get that from the construction of the File object above which appends lib to the value of java.home and not jre/lib. > Andrew. Thanks, -- Andrew :)