Community
Participate
Working Groups
Created attachment 88430 [details] EE description file used Build ID: I20080129-1400 Steps To Reproduce: 1. Use a new workspace and go to Window->Preferes..->Java->Installed JREs. Select Add. 2. Select Execution Environment Description and select a Definition-File using the "File.." browse option. 3. The ee file name is listed as one of the JREs along with the info from the ee file as "Default VM Arguments" as it should. 4. Select the new JRE corresponding to the ee file and change the compiler compliance level under Window->Preference->Java->Compiler to 1.5 which is what the ee file (see attached file) is set for. 5. Save and close the Window prefrences dialog. 6. Not sure if it makes a difference I had a simple Hello-World java project. 7. Open the window prefereces dialog and go to Installed JRE and you will see a msg at the top saying that "The selected JRE does not support the current compiler compliance level of 1.5". 8. A message box shows up in a few seconds with the message-"UPdate Installed JREs - Reason:java.lang.NullPointerException. 9. The JRE I am pointing to is jclDesktop JRE (J9 VM) from Expeditor 6.1.2 release and the paths in the ee file are hard coded to point to the location. More information: Here is the stack trace: java.lang.NullPointerException at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2428) at org.eclipse.jdt.internal.core.JavaProject.projectPrerequisites(JavaProject.java:2269) at org.eclipse.jdt.internal.core.ProjectReferenceChange.updateProjectReferencesIfNecessary(ProjectReferenceChange.java:47) at org.eclipse.jdt.internal.core.ChangeClasspathOperation.classpathChanged(ChangeClasspathOperation.java:61) at org.eclipse.jdt.internal.core.SetContainerOperation.executeOperation(SetContainerOperation.java:112) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:785) at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:4713) at org.eclipse.jdt.internal.launching.JREContainerInitializer.initialize(JREContainerInitializer.java:69) at org.eclipse.jdt.internal.launching.LaunchingPlugin$VMChanges.rebind(LaunchingPlugin.java:302) at org.eclipse.jdt.internal.launching.LaunchingPlugin$VMChanges.access$0(LaunchingPlugin.java:267) at org.eclipse.jdt.internal.launching.LaunchingPlugin$1.run(LaunchingPlugin.java:255) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4660) at org.eclipse.jdt.internal.launching.LaunchingPlugin$VMChanges.doit(LaunchingPlugin.java:259) at org.eclipse.jdt.internal.launching.LaunchingPlugin$JREUpdateJob.run(LaunchingPlugin.java:339) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Also I was using the same EE description file (aa.ee) for 3.4M2 and it was working fine except when I tried to debug with java level set to 1.5.
The ee file has a trailing space after the library.level. "-Dee.class.library.level=J2SE-1.5 " We fail to find any EE mathing this key. I added code to trim attribute values (which is safe in general). I think that will fix this problem, but perhaps JCore still has a potential NPE here. As a workaround, you should be able to modify your ee file to proceed.
I released a fix to ensure we trim preceeding and trailing whitespace from properties in the ee file. However, I cannot reproduce the NPE with or without the fix. Moving to JCore for comment.
I seem to see the NPE after I create a dummy Java project. Initially when I select the JRE from the ee file and select it and close and reopen the prefs it gives me the msg in the dialog "The selected JRE does not support the current compiler compliance level of 1.5". But does not give the NPE. Once I create a java project I start seeing the error dialog with the NPE msg. It seems to be n some sort of a loop since the msg box keeps getting displayed every few seconds and the error log is updated.
To reproduce: 1. Start a new workspace 2. Create a new Java project 'Test' in Java perspective 3. Remove 'Test/src' from its build path 4. Window > Preferences > Java > Installed JREs > Add > Execution Environment Description > Next > Files... 5. Select the EE file from comment 0 6. Finish 7. Select 'aa' 8. OK Observe: You get an error dialog with the NPE
There is a race condition as several threads are modifying the classpath at the same time (due to bug 217447).
Created attachment 88559 [details] Proposed fix Note there is no regression test since this is a concurrency problem.
Sridhar, it looks like your "-Djava.home" property points to a location that does not exist. Please verify, and see bug 217447, which will provide a fix for this.
Fix released for 3.4M5
Tested in Build I20080204-0800 and this is fixed. With the wrong -Djava.home I get a nice msg letting me know.
Verified for 3.4M5 using build I20080204-0010.