JavaHL not loading (NoClassDefError)

后端 未结 5 1600
长发绾君心
长发绾君心 2021-02-09 14:24

I\'ve reinstalled Windows and unzipped a fresh copy of Eclipse. Despite this, I\'ve been unable access an ssh repository via Subclipse. The issue seems to be with JavaHL and the

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-09 14:38

    Some tales with solution below.

    First, tales. I had a similar error with:

    • svn, version 1.8.8 (r1568071);
    • Eclipse Mars.1;
    • Ubuntu Linuxtrusty;
    • with either:

      • Subclipse from Eclipse update site https://dl.bintray.com/subclipse/releases/subclipse/latest/ (as of Nov. 22, 2016) or:
      • Subclipse from Eclipse Marketplace Subclipse version 1.10.13

      (I was toggling both subclipse sources within a single Eclipse Mars.1 instance).

    Error messages were:

    1. java.lang.LinkageError: Native library version must be at least 1.9.0, but is only 1.8.8 (r1568071)
      at org.apache.subversion.javahl.NativeResources.init(NativeResources.java:148)
      at org.apache.subversion.javahl.NativeResources.loadNativeLibrary(NativeResources.java:111)
      at org.apache.subversion.javahl.types.Version.(Version.java:40)
      at org.apache.subversion.javahl.NativeResources.init(NativeResources.java:145)
      at org.apache.subversion.javahl.NativeResources.loadNativeLibrary(NativeResources.java:111)
      at org.apache.subversion.javahl.SVNClient.(SVNClient.java:52)
      at org.tigris.subversion.svnclientadapter.javahl.JhlClientAdapterFactory.isAvailable(JhlClientAdapterFactory.java:183)
      at org.tigris.subversion.clientadapter.javahl.Activator.isAvailable(Activator.java:90)
      at org.tigris.subversion.clientadapter.Activator.getClientAdapter(Activator.java:81)
      at org.tigris.subversion.subclipse.core.SVNClientManager.getAdapter(SVNClientManager.java:127)
      at org.tigris.subversion.subclipse.core.SVNClientManager.getSVNClient(SVNClientManager.java:94)
      at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getSVNClient(SVNProviderPlugin.java:462)
      at org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation.getSVNClient(SVNRepositoryLocation.java:257)
      at org.tigris.subversion.subclipse.core.resources.RemoteFolder.getMembers(RemoteFolder.java:164)
      at org.tigris.subversion.subclipse.core.resources.RemoteFolder.members(RemoteFolder.java:260)
      at org.tigris.subversion.subclipse.ui.operations.FetchMembersOperation.execute(FetchMembersOperation.java:41)
      at org.tigris.subversion.subclipse.ui.operations.SVNOperation.run(SVNOperation.java:90)
      at org.tigris.subversion.subclipse.ui.repository.model.SVNRepositoryRootElement.fetchDeferredChildren(SVNRepositoryRootElement.java:73)
      at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:232)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    2. java.lang.NoClassDefFoundError: Could not initialize class org.apache.subversion.javahl.SVNClient
      at org.tigris.subversion.svnclientadapter.javahl.JhlClientAdapter.(JhlClientAdapter.java:57)
      at org.tigris.subversion.clientadapter.javahl.Activator.getAdapter(Activator.java:64)
      at org.tigris.subversion.clientadapter.Activator.getClientAdapter(Activator.java:84)
      at org.tigris.subversion.subclipse.core.SVNClientManager.getAdapter(SVNClientManager.java:127)
      at org.tigris.subversion.subclipse.core.SVNClientManager.getSVNClient(SVNClientManager.java:94)
      at org.tigris.subversion.subclipse.core.SVNProviderPlugin.getSVNClient(SVNProviderPlugin.java:462)
      at org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation.getSVNClient(SVNRepositoryLocation.java:257)
      at org.tigris.subversion.subclipse.core.resources.RemoteFolder.getMembers(RemoteFolder.java:164)
      at org.tigris.subversion.subclipse.core.resources.RemoteFolder.members(RemoteFolder.java:260)
      at org.tigris.subversion.subclipse.ui.operations.FetchMembersOperation.execute(FetchMembersOperation.java:41)
      at org.tigris.subversion.subclipse.ui.operations.SVNOperation.run(SVNOperation.java:90)
      at org.tigris.subversion.subclipse.ui.repository.model.SVNRepositoryRootElement.fetchDeferredChildren(SVNRepositoryRootElement.java:73)
      at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:232)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

    The LinkageError above might probably be caused by incompatibility with [3]:

    [3]:

    Requirements - current master

    • [...]

    • Subversion 1.9 JavaHL client libraries

    (this is an excerpt from https://github.com/subclipse/subclipse/wiki, see section Requirements - current master).

    To solve this incompatibility for my svn 1.8.8, I tried to install the legacy

    SVN 1.8.x - https://dl.bintray.com/subclipse/archive/release/1.10.x/

    (this is an excerpt from https://github.com/subclipse/subclipse/wiki, see section Legacy Releases).

    Eclipse told Cannot perform operation and as an alternate solution I chose Update my installation to be compatible with the items being installed option in the radio buttons group of alternate solutions. Then, I clicked Next a few times, confirmed the licenses, replied to unsigned content warning, and restarted Eclipse when prompted. This did not help as various Error Log view entries appeared.


    Second, a solution.

    • So, I created a new Eclipse installation with -Djava.library.path=/usr/lib/i386-linux-gnu/jni/ at -vmargs (took Eclipse installer from http://www.eclipse.org/downloads/packages/release/Mars/2).
    • Installed Subclipse for my svn 1.8.8 from the legacy Eclipse update site https://dl.bintray.com/subclipse/archive/release/1.10.x/.
    • Switched from JavaHL to pure Java SVNKit to avoid asking for password on every repo operation with svn+ssh: URLs (see https://stackoverflow.com/a/15949392/529442 on this).
    • Voila, all works great! Enjoy.

提交回复
热议问题