Community
Participate
Working Groups
build 20020502 The following code on JDTCompilerAdapter.setupJavacCommand() causes a NPE if there JRE_LIB does not exist: String jre_lib = JavaCore.getClasspathVariable("JRE_LIB").toOSString(); //$NON- NLS-1$ if (jre_lib == null) { throw new BuildException(Util.bind ("ant.jdtadapter.error.missingJRELIB")); //$NON-NLS-1$ } It would be helpful if the error message could say that the two possibilities to solve the problem are or setting a varible called JRE_LIB or setting the parameter bootclasspath on the Ant javac task.
Indeed the code should be: IPath jre_lib = JavaCore.getClasspathVariable("JRE_LIB"); //$NON-NLS-1$ if (jre_lib == null) { throw new BuildException(Util.bind ("ant.jdtadapter.error.missingJRELIB")); //$NON-NLS- 1$ } ....jre_lib.toOSString(); If the jre_lib entry is not set, JavaCore.getClasspathVariable("JRE_LIB") returns null and then toOSString() throws a NPE.
Fixed and released in HEAD.