Bug 126419

Summary: ecj should include value of "java.endorsed.dirs" system property in its bootclasspath
Product: [Eclipse Project] JDT Reporter: Thomas Fitzsimmons <fitzsim>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: darin.eclipse, overholt, tjwatson
Version: 3.1   
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Proposed fix
none
Regression tests updated none

Description Thomas Fitzsimmons CLA 2006-02-03 16:58:38 EST
Eclipse's Java compiler should include the value of the "java.endorsed.dirs" system property on its bootclasspath by default.  This value should be overridable on the command line with the -endorseddirs option.
Comment 1 Olivier Thomann CLA 2006-02-03 21:06:33 EST
According to what is in this page http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html, not any packages can be retrieved from the endorsed library directories.
Is this what you want?
The contents of the endorsed library directories should then be inserted before the contents of the bootclasspath.
Is this what you expect?
Comment 2 Thomas Fitzsimmons CLA 2006-02-04 02:26:21 EST
The documentation I've found on javac's handling of endorsed directories is from the 1.5 -help output:

  -endorseddirs <dirs>       Override location of endorsed standards path

and the manpage:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html

-Djava.endorsed.dirs=directories
    Override the location of endorsed standards path.

These options lead me to believe that endorsed directories should be handled in a similar way to extension directories.  I don't know where in the bootclasspath order endorsed jars should be included though.

As for a jar's "endorsed" status, I would prefer that ecj not check that.  I'd rather it just put any jar it finds in the endorsed directory on the bootclasspath.
Comment 3 Philipe Mulet CLA 2006-02-05 11:20:39 EST
Darin - are you supporting endorsed dirs on JRE container ? If so, what spec are you using ?
Comment 4 Darin Wright CLA 2006-03-13 11:34:17 EST
Yes, we support endorderd dirs on the JRE container. When a JRE is added to the workspace, we execute the JRE to retrieve its java.endorsed.dirs attribute and these locations to the JRE container.
Comment 5 Olivier Thomann CLA 2006-03-13 11:36:45 EST
So you simply retrieve the jars within this folder? Do you actually filter the classes from the jars to retrieve only some specific packages?
Comment 6 Darin Wright CLA 2006-03-13 11:42:38 EST
We use the jars, we do not retrieve specific packages.
Comment 7 Philipe Mulet CLA 2006-04-12 12:19:15 EDT
+1 for 3.2RC2
Comment 8 Olivier Thomann CLA 2006-04-17 15:42:10 EDT
Created attachment 38712 [details]
Proposed fix

Make endorsed dirs similar to extdirs and prepend endorsed jars in the bootclasspath.
Comment 9 Olivier Thomann CLA 2006-04-17 15:43:07 EDT
Created attachment 38713 [details]
Regression tests updated

BatchCompiler test12 needs to be updated.
Comment 10 Olivier Thomann CLA 2006-04-18 14:37:10 EDT
Fixed and released in HEAD.
Please try it and let me know if this is the expected behavior.
Comment 11 Olivier Thomann CLA 2006-04-19 18:48:38 EDT
In case this property is not set, a string is left in the classpath and it is causing an ArrayStoreException.
Fix is trivial.
Fixed and released in HEAD.
Comment 12 Darin Swanson CLA 2006-04-21 14:09:10 EDT
*** Bug 137597 has been marked as a duplicate of this bug. ***
Comment 13 Olivier Thomann CLA 2006-04-28 11:55:06 EDT
Verified with I20060427-1600 for 3.2RC2