views:

50

answers:

1

Hello

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

+1  A: 

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.

trashgod
Instead of 3 get the latest Java from Software update
Mark
FOUND!!! This was the problem: /Library/Java/Extensions/xerces.jarAfter removing it, eclipse works!I still have no Idea what was the cause though
Nicola Montecchio
Something must have put it there and that cannot be done without administrative rights. What have you installed of OS X branded java related software since the machine was installed?
Thorbjørn Ravn Andersen
@Mark: Thanks; software update added. Looks like I'll have to tinker with the numbering. :-)
trashgod
@Nicola Montecchio: `EclipseAdaptorHook`, was likely finding `xerces.jar in the `java.library.path` under `/Library/Java/Extensions/`.
trashgod
@trashgod - 3 and 4 need swapping around (Actually could try 3 on its own and if that fails then 4)
Mark
@Mark: Thanks for looking at this. I had the nested list indented incorrectly, which caused the renumbering to restart. I think it's right now, but please feel free to edit the answer.
trashgod
oops renumbering seesm to have confused me - I meant Software update after java from the install DVD
Mark
@Mark: OK, that makes sense; one should run software update after installing from DVD.
trashgod