Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333576

Summary: [jre] "JRE System Library" default not used properly after Java update
Product: [Eclipse Project] JDT Reporter: Michael Rennie <Michael_Rennie>
Component: DebugAssignee: Michael Rennie <Michael_Rennie>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, darin.eclipse, eclipse-bugs, eclipsebugs, linux.news, Michael_Rennie, Mike_Wilson, remy.suen, Sam.Halliday, sghung, tomasz, vargok
Version: 3.4.1Flags: curtis.windatt.public: review+
Target Milestone: 3.6.2   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 266651    
Bug Blocks:    
Attachments:
Description Flags
fix none

Description Michael Rennie CLA 2011-01-05 10:54:07 EST
This is a good candidate for 3.6.2 as well. It is a small fix that prevents OS updates from breaking Eclipse settings / workspaces.

+++ This bug was initially created as a clone of Bug #266651 +++

Build ID: M20080911-1700

Steps To Reproduce:
1. Updated Sun Java 1.6.0-u7 to 1.6.0-u11 via SuSE's updater.
2. /usr/bin/java -> /etc/alternatives/java -> /usr/lib/jvm/jre-1.6.0.u11-sun/bin/java , similar for /usr/lib/jvm/* (SuSE automatically updated where the system Java points to)
2. Restarted computer and Eclipse
3. Opened same workspace again
4. Projects failed (see Actual result below)
5. Package Explorer | myproject | context menu | Properties | Java Build Path | Libraries shows "JRE System Library [java-1.6.0.u11-sun-1.6.0.u11]", which is correct: the new and existing Java.
6. I looked everywhere I could find, in Project settings and Window | Preferences, I couldn't see any u7 referenced.


Actual result:
Description	Resource	Path	Location	Type
Project 'myproject' is missing required library: '/usr/lib/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/lib/resources.jar'	myproject		Build path	Build Path Problem

Expected result:
Uses new Java version.

Workaround:
In Package Explorer | myproject | context menu | Properties | Java Build Path | Libraries , double-click on "JRE System Library [java-1.6.0.u11-sun-1.6.0.u11]". A dialog comes up, saying "(*) Workspace default JRE (java-1.6.0.u11-sun-1.6.0.u11)". Instead, check "( ) Alternate JRE [java-1.6.0.u11-sun-1.6.0.u11]" and click "Finish" button. The Error goes away. Go in the same dialog again and check "Workspace default JRE" again. The error goes not come back, although it's now the same setting as it was when the error appeared. This confirms that it's an Eclipse bug.

More information:
Comment 1 Michael Rennie CLA 2011-01-05 11:28:21 EST
Created attachment 186098 [details]
fix
Comment 2 Michael Rennie CLA 2011-01-05 11:30:41 EST
Branched jdt.launching and applied patch to 3.6.2.

Please verify Curtis.
Comment 3 Curtis Windatt CLA 2011-01-05 12:47:24 EST
Verified.