Skip to main content

Java Tiger on Mac Tiger Endorsed Trouble (and workaround)

Posted by scottschram on May 8, 2005 at 9:43 PM PDT

I've just installed Mac OS 10.4.0 and added the J2SE 5.0 R1 available from Apple.

The 5.0 release installs alongside the 1.4.2 release. However, after that installation, I had problems with the 1.4.2 producing error messages:

$ java -version
HotSpot Error: update_sharing has failed
java version "1.4.2_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07-215)
Java HotSpot(TM) Client VM (build 1.4.2-50, mixed mode)
$ An unrecoverable error has occured while writing the shared archive file.
Too many jar files to share.

The same error message shows up in Eclipse, however, everything seems to work ok.

In the OS 10.3.9 release there was a bug related to the Java Shared Archive. "The JSA contains the preprocessed internal HotSpot JVM representations of common standard Java classes that would otherwise be found and processed from the standard classes.jar file."

Apple issued Java Update for Mac OS X v10.3.9 which removes the JSA.

I guess that J2SE 5.0 R1 includes a fix for the JSA in 1.4.2 that runs once when you next start a 1.4.2 JVM.

The program is named "update_sharing" and is in:

/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands

It takes one argument: 1.3, 1.4 or 1.5.

update_sharing ran into a problem rebuilding the JSA because I had several JARs in the 1.4.2 endorsed directory.

/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/endorsed/

This is a standard Java practice and it allows using a newer XSLT processor or XML parser than the one in the release.

Here are the files I had in that directory:

dom-jaxp-1.3.jar jaxp-api-1.3.jar sax-jaxp-1.3.jar xalan-2.6.0.jar xercesImpl-2.6.2.jar xml-apis-2.6.0.jar

The workaround is to move these files out of the endorsed directory, and run update_sharing manually, or let Java run it automatically with "java -version" one time. Then move the files back. It works, but I'm not sure if it's getting any benefits from the JSA.

(This was reported to Apple.)

Related Topics >>