Community
Participate
Working Groups
I am using the JDT Compiler Adapter outside of eclipse and if I do not provide a bootclasspath in my build.xml it throws an ExceptionInInitializerError. Here is the stack trace: java.lang.ExceptionInInitializerError at java.lang.Throwable.<init>(Throwable.java:61) at java.lang.ExceptionInInitializerError.<init> (ExceptionInInitializerError.java:72) at java.lang.Class.initialize(Class.java) at org.eclipse.jdt.core.JavaCore.getClasspathVariable (JavaCore.java:1025) at org.eclipse.jdt.core.JDTCompilerAdapter.setupJavacCommand (JDTCompilerAdapter.java:91) at org.eclipse.jdt.core.JDTCompilerAdapter.execute (JDTCompilerAdapter.java:52) at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:842) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682) at org.apache.tools.ant.Task.perform(Task.java:341) at org.apache.tools.ant.Target.execute(Target.java:309) at org.apache.tools.ant.Target.performTasks(Target.java:336) at org.apache.tools.ant.Project.executeTarget(Project.java:1339) at org.apache.tools.ant.Project.executeTargets(Project.java:1255) at org.apache.tools.ant.Main.runBuild(Main.java:609) at org.apache.tools.ant.Main.start(Main.java:196) at org.apache.tools.ant.Main.main(Main.java:235) Caused by: java.lang.NullPointerException at java.lang.Throwable.<init>(Throwable.java:61) at java.lang.Throwable.<init>(Throwable.java:75) at java.lang.NullPointerException.<init>(NullPointerException.java:59) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.getJavaPluginWorking Location(IndexManager.java:213) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.<init> (IndexManager.java:64) at org.eclipse.jdt.internal.core.DeltaProcessor.<init> (DeltaProcessor.java:185) at org.eclipse.jdt.internal.core.JavaModelManager.<init> (JavaModelManager.java:465) at org.eclipse.jdt.internal.core.JavaModelManager.<clinit> (JavaModelManager.java:450) at java.lang.Class.initializeImpl(Native Method) at java.lang.Class.initialize(Class.java) at org.eclipse.jdt.core.JavaCore.getClasspathVariable (JavaCore.java:1025) at org.eclipse.jdt.core.JDTCompilerAdapter.setupJavacCommand (JDTCompilerAdapter.java:91) at org.eclipse.jdt.core.JDTCompilerAdapter.execute (JDTCompilerAdapter.java:52) at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:842) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682) at org.apache.tools.ant.Task.perform(Task.java:341) at org.apache.tools.ant.Target.execute(Target.java:309) at org.apache.tools.ant.Target.performTasks(Target.java:336) at org.apache.tools.ant.Project.executeTarget(Project.java:1339) at org.apache.tools.ant.Project.executeTargets(Project.java:1255) at org.apache.tools.ant.Main.runBuild(Main.java:609) at org.apache.tools.ant.Main.start(Main.java:196) at org.apache.tools.ant.Main.main(Main.java:235)
The problem comes from the fact that the code is not checking is eclipse is running prior to try to get the value of a classpath variable. I would fix it by using the java.home instead of the JRE_LIB as long as we don't have a good story for running an ant task in a different VM than the one on which Eclipse is running. We might end up with the same problem.
Agreed
Fixed and released in HEAD stream.
Change target milestone.
Verified.
[javac] BUILD FAILED: file:C:/Nokia/Documents/PhoneShop/PhoneShop/PhoneShop/PhoneShop/build.xml:92: Compiler Adapter 'org.eclipse.jdt.core.JDTCompilerAdapter' can't be found.
and? Could you please explain how you got this? This has nothing to do with the original problem. It looks like the ant adapter is not on the ant classpath. Open a new bug report against Platform/Ant.