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  <[EMAIL PROTECTED]>
 > >  >
 > >  >         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) {


Andrew.

Reply via email to