Search code examples
javamacosinstallationxerces

problems with java installation (xerces) on mac


I'm using MacOsX 10.6.4.

Some time ago I run into problems with Eclipse (it wouldn't start anymore - I opened a question here and followed all the suggestion but with no luck). Then I also run into very similar problems with other java applications, of which the last one is the android sdk. All these problems seem to be related with xerces/xml, as the following exception shows (just running tools/android and clicking on the "available updates" button):

Exception in thread "Loading Source" java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredElementNSImpl.getTextContent()Ljava/lang/String;

Is there any way to repair the java installation (reinstalling the OS is out of the question)?

thanks a lot

Nicola Montecchio


Solution

  • Some things to try:

    1. Look for adventitious xerces JARs that may have been inadvertently left in one of the directories of the System property java.ext.dirs.

      /Users/*/Library/Java/Extensions
      /Library/Java/Extensions
      /System/Library/Java/Extensions
      /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext
      
    2. Use spotlight to search for extraneous xerces JARs outside of Eclipse.

    3. Remove /Applications/eclipse and ~/.eclipse; reinstall Eclipse.

    4. Reinstall Java from the the installer DVD: /Volumes/Mac OS X Install DVD/Optional Installs/Xcode Tools/Packages/JavaSDK.pkg.

    5. Check Software update.