57

I've run into problems installing the latest Subclipse plug in. I saw this post: subclipse: Unable to load default SVN Client, but the answer appears to be specific for Subclipse 1.6.x, and I think 1.8.x is presenting new issues. I'm on a mac, 10.6.8, with Eclipse Indigo. I have Subclipse 1.8.4 installed, with the Subversion JavaHL Native Library Adapter 1.7.3 installed, which is the correct version of JavaHL for Subclipse 1.8, according to http://subclipse.tigris.org/wiki/JavaHL#head-5ccce53a67ca6c3965de863ae91e2642eab537de

When I tried to add a new SVN repository, it says "operation in progress", then gives me this error:

Failed to load JavaHL Library.
These are the errors that were encountered:
no libsvnjavahl-1 in java.library.path
no svnjavahl-1 in java.library.path
no svnjavahl in java.library.path
java.library.path = .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

I also tried uninstalling all the subclipse plugins, and instead installing the openCollabNet subversion package, as recommended here: http://subclipse.tigris.org/wiki/JavaHL#head-5bf26515097c3231c1b04dfdb22c036bc511926b

But when I tried to add a new SVN repository, I received the error: "Unable to load defaul SVN client"

Any ideas what I'm doing wrong?

Thanks

Community
  • 1
  • 1
matthewb
  • 1,323
  • 2
  • 12
  • 18
  • Are you sure the lib was placed in the default java lib path or did you adjust the lib path in Eclipse? – prodigitalson Feb 15 '12 at 23:40
  • No, I'm not sure. How would I check this? There's a jar in the plug-ins folder for eclipse called org.tigris.subversion.clientadapter.javahl_1.7.3.jar Do I need to move that to another folder? Where do I find the default java lib path? – matthewb Feb 15 '12 at 23:48
  • See @Rafael Ramos 's answer for an alternative pure Java implementation called SVNKit. – 8bitjunkie Dec 04 '14 at 10:43

10 Answers10

57

Go to Eclipse > Preferences > Team > SVN Under "SVN interface", choose "SVNKit". Worked for me.

Rafa Bytes
  • 695
  • 5
  • 5
  • This is my preferred approach. Apache `Subversion` is written in `C` and `JavaHL` is a language bindings dependency that allows `Subversion` to interface with `Java`. A common cause of headache is that *32* bit `Subversion` and `JavaHL` dependencies are installed and run on a *64* bit `JVM`. `SVNKit` is a pure java implementation of Subversion and an alternative to the `Apache Subversion` + `JavaHL` pairing. – 8bitjunkie Dec 04 '14 at 10:42
  • Easy and effective! Now, if you excuse I will continue the real work. – Josh Jun 30 '15 at 10:27
  • I'd like to script this. Is this possible? – 8bitjunkie Nov 17 '15 at 02:30
  • except it sucks: you can't merge – chris Nov 30 '15 at 11:22
36

I want to clarify all the steps I took to resolve this problem, in case future readers who are complete novices like me are banging their head against this like I was. As of Feb, 2012, the most current version of Subclipse is 1.8, which requires Subversion 1.7. It seems like macs need additional JavaHL libraries, which I can only find for Subversion 1.6. So you have to remove Subclipse 1.8 and instead install version 1.6. This may all change if CollabNet provides JavaHL libraries for subversion 1.7.

  1. Remove Subclipse 1.8 - In Eclipse, under the help menu, choose Install New Software. Near the bottom, on the right hand side, click the link "What is already installed?" Near the top, you should see CollabNet Merge Client, version 3.0.x, or something similar (I think this is installed with Subclipse 1.8), click uninstall and follow the steps to uninstall. (Eclipse will then ask you to restart, click not now. ) Scroll down to the bottom, if you see Subclipse, version 1.8.x, click uninstall and follow the steps. Again, click "not now" when eclipse asks to restart.

  2. Download Subclipse 1.6. You should still be in the Install New Software window. Near the top, where is says Work with: paste in http://subclipse.tigris.org/update_1.6.x, download all the files (you may not need these, but I downloaded them all to be safe). Again, eclipse will ask you to restart, hit not now, and close down eclipse instead.

  3. Download Subversion from CollabNet - Go to http://www.open.collab.net/downloads/community/ and download the Subversion 1.6 for the correct version of your mac OS. After downloading, open the installer and install it. EDIT: You may want to restart your mac at this point.

  4. Add subversion to java default library path - Now it gets a little tricky. Open the eclipse.ini file (for instructions to find the eclipse.ini file, read this: http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Mac_OS_X_Example - note that it is not the same as the config.ini file in the eclipse folders). After opening the eclipse.ini file, copy and paste -Djava.library.path=/opt/subversion to the end of it. Save and close.

  5. Now restart Eclipse, and hopefully it will work.

I have no idea why this is such a process. I installed Sublipse on a windows machine last year, and it was really easy. Thanks to everyone for their help!

Just an additional note: this is also useful in order to downgrade from 1.8 to 1.6 and be able to sync with older repositories.

juanignaciosl
  • 3,435
  • 2
  • 28
  • 28
matthewb
  • 1,323
  • 2
  • 12
  • 18
  • 1
    My only 2 cents is that, after step 3 you might want to restart your mac. I had a little trouble (some error message like "XML data is not well-formed" ) when trying to check out a svn project. Everything goes fine after i restart my mac. – pwang Feb 19 '12 at 07:25
  • Thanks for the tip, I'll edit accordingly (it usually doesn't hurt to restart...) – matthewb Feb 20 '12 at 17:55
  • Thanks for the instructions, they saved me a lot of time and frustration. Just a note, I had to change the java.library.path to /opt/subversion/lib (I use STS and am on Mac OS X Lion). Also, if anything else needs something from java.library.path (it's used for any native OS files) then you may need to copy the JavaHL files of interest (in the error message) to the default java.library.path (also listed in the error if the -D switch is not present) as opposed to changing the path entirely just for svn. – Marquee Sep 10 '12 at 19:33
  • Subversion is not available for OS X 10.7 yet. Collab.net does have a download but the packaging is not proper hence could not be installed. Is there any other way by which subversion can be installed? – Ram Oct 01 '12 at 10:50
  • For those coming to this later who are looking to setup subclipse 10.8.x you'll want to follow the instructions in @roko's answers – Ralph Callaway Oct 10 '12 at 20:41
16

I used the answer provided by Rafael https://stackoverflow.com/a/13090191/1446834

It worked for me also. enter image description here

Community
  • 1
  • 1
Pranjal
  • 179
  • 1
  • 7
12

To fix this, just install the package with:

sudo apt-get install libsvn-java

You must config eclipse.inito add path /jni

For example:

-Djava.library.path=/usr/lib/x86_64-linux-gnu/jni

On Ubuntu-13.04 32bits you need to edit the file:

$ sudo vi /usr/lib/eclipse/eclipse.ini

And add the path:

-Djava.library.path=/usr/lib/i386-linux-gnu/jni

From this blog

danangindra
  • 190
  • 2
  • 9
7

Check out this link for solution: http://www.breathedevelopment.com/node/49 It worked for me and it is simple, hope it helps

# sudo port -v selfupdate
# sudo port install subversion-javahlbindings
# sudo port upgrade --enforce-variants active +universal
j0k
  • 22,600
  • 28
  • 79
  • 90
roko
  • 111
  • 1
  • 3
  • Lone link is [considered a poor answer](http://stackoverflow.com/faq#deletion) since it is meaningless by itself and target resource is not guaranteed to be alive in the future. Please try to include at least summary of information you are linking to. – j0k Sep 04 '12 at 10:29
  • 1
    +1 since you can use subclipse 10.8.x with this route, nb: you need to install xcode and macports first before you can go this route – Ralph Callaway Oct 10 '12 at 20:41
  • 1
    The installation of SVN on Eclipse on a Mac is and has been an infinite headache for years. Here is what I did to get it to work: 1. Download Eclipse Juno EE for mac 64 bit 2. Go install macports for mountain lion 3. Run the commands in this post (the 3 commands that start with "sudo") This step took me a good 30 minutes at least. Reboot to be safe 4. Install subclipse 1.8x ...to do this, go to Eclipse/install new software/add in http://subclipse.tigris.org/update_1.8.x and go grab it. You can look for more precise directions elsewhere for this step 5. Done – user798719 Jan 18 '13 at 07:00
  • I already have a lot of ports installed. That last command upgrades everything with +universal. – geekinit Oct 14 '13 at 18:18
  • Universal means your ports are built to support Intel and PowerPC. Can you elaborate on why this is necessary? – geekinit Oct 14 '13 at 18:29
  • Finally an easy solution to this. I've been using the SVNKit solution listed here for a long time, but today I had to do a MERGE with svn 1.8, and it failed. I used MacPorts to install subversion-javahlbindings as described here, but I didn't issue the third command to upgrade to universal, and my merge worked flawlessly. Thanks roko! – Steve Warren May 29 '14 at 21:10
  • This answer solves my issues with svn 1.10 and aptana in mac, Thanks! – mjimcua Mar 24 '15 at 13:45
6

I am on Ubuntu and don't have a Mac to validate my answer, but obviously (from your error message) your JavaHL library cannot be found on the java.library.path.

This has nothing to do with the plugin you mentioned (org.tigris.subversion.clientadapter.javahl_1.7.3.jar), don't move that anywhere else. From your link (http://subclipse.tigris.org/wiki/JavaHL#head-5ccce53a67ca6c3965de863ae91e2642eab537de) I assume you tried to install from openCollabNet, which installs the library into /opt/subversion, which is not listed on your java.library.path. You could give it a try and edit eclipse.ini to contain a line like

-Djava.library.path=/opt/subversion

in the -vmargs section; I am not sure if this will solve your problem but it might give you an indication (for example, by getting another error message to proceed with).

I am sorry that I cannot really check my answer, but this hint might help you solving the issue.

evandor
  • 799
  • 1
  • 10
  • 23
  • Thanks, I think that did it, although I had to uninstall the most recent version of subclipse (1.8), and install the older version (1.6), because the only version of the JavaHL library from openCollabNet is 1.6, but after I did that, it worked. – matthewb Feb 16 '12 at 17:20
3

I use Eclipse Version: Kepler Service Release 1, Build id: 20130919-0819 on Mac 10.9 and I managed to fix this by installing Subversion using brew:

brew install --universal --java subversion

After running the above command, the installation summary was displayed stating:

svntools have been installed to: /usr/local/opt/subversion/libexec

I went to the /usr/local/opt/subversion/ folder and I searched for the needed jars. I found them in /lib, so in the eclipse.ini file I added:

-Djava.library.path=/usr/local/opt/subversion/lib

I also installed the Subversion plugin from Eclipse using this link:

http://subclipse.tigris.org/update_1.10.x

and it fixed the problem.

Teo P
  • 31
  • 3
0

Try to install the javaHL conector, you could download these from this web site

http://www.collab.net/downloads/subversion#tab-3

Rubén Fanjul Estrada
  • 1,296
  • 19
  • 31
0

I finally gave up using JavaHL and I installed SVNKit 1.6 (make sure to install "SVN Client Adapter" and "SVNKit Adapter" as well) instead.

...And it worked.

Guillaume
  • 477
  • 5
  • 6
0

In case of run on macosx the correct way to install using brew for java is:

brew install subversion --with-java

then you should do the following:

sudo mkdir -p /Library/Java/Extensions
sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib

like mention on the wiki of the project subclipse-wiki

nekperu15739
  • 3,311
  • 2
  • 26
  • 25