The Source for Java Technology Collaboration
User: Password:



Scott Schram

Scott Schram's Blog

Java Tiger on Mac Tiger Endorsed Trouble (and workaround)

Posted by scottschram on May 08, 2005 at 09:43 PM | Comments (2)

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.)


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • I had the same problem with java on Mac using 10.3.9. I resolved the problem by installing and using Pacifist from http://www.charlessoft.com. I used the the software to re-install the java package and then updated the package using Software Update. It worked!

    Posted by: no137 on May 23, 2005 at 10:40 PM

  • I got the same HotSpot Error with Java Version "1.4.2_09" on Mac OS X 10.4.3, with nothing in my /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/endorsed/ directory.

    To get rid of the error, I had to repair the disk permissions using the Disk Utility.

    / Applications / Utilities / Disk Utility
    First Aid -> Repair Disk Permissions

    Posted by: donzola on November 11, 2005 at 09:22 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds