Eclipse 安装Subclipse[SVN]遇到的问题及解决


安装完成之后,重启eclipse,打开工程,右击“team”--“share project”--"SVN",提示以下错误:
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 = /usr/java/jdk1.7.0_02/jre/lib/i386/client:/usr/java/jdk1.7.0_02/jre/lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib


打开提示窗口指示的链接 http://subclipse.tigris.org/wiki/JavaHL
说明 JavaHL 是Subclipse的一部分,同时要注意对应的版本号,由于我安装的是 Subclipse V1.8.x,需要安装 SVN/JavaHLV1.7.x;

Get the right version!

Before explaining what JavaHL is, it is important that you know what version you need for the version of Subclipse you are using. JavaHL is part of Subversion, so it's version matches that of the Subversion command line client you have installed. Each Subclipse version typically only supports a single Subversion client version (due to API differences). Make sure you get the right version of JavaHL for your Subclipse version.

Current Versions

Subclipse Version

SVN/JavaHL Version

1.8.x

1.7.x

1.6.x

1.6.x

1.4.x

1.5.x

1.2.x

1.4.x

1.0.x

1.4.x


以下是 SVN/JavaHL在linux中的安装方法。

Linux

This is the most complicated because there are so many distributions.

CollabNet provides a client RPM for Red Hat that includes JavaHL (http://www.collab.net/downloads/subversion/redhat.html). In my experience, this RPM works on other Linux distributions. On RPM-based distributions like CentOS or Suse, it should just be a matter of installing the RPM. On Debian-based systems, I was able to use the alien package to install the RPM.

Of course many Linux distributions, such as Ubuntu, do a good job of providing up to date Subversion packages, and most of these now provide JavaHL as well. Typically, the JavaHL library is in a separate package that is dependent on the main Subversion package. In Debian/Ubuntu the package name is libsvn-java so you can just run this command to install the library:

$ apt-get install libsvn-java # Use sudo in Ubuntu 

Next, find the path where the JavaHL library is installed, as you will need to know this path for the following instructions:

$ find / -name libsvnjavahl-1.so # Use sudo in Ubuntu 

Although the library is installed, you still have to tell Java (when used for Eclipse) where to find it. The JVM on Linux does not look in a lot of the standard locations to find the libraries. (This could obviously change in the future.) For example, 32-bit Debian/Ubuntu uses a standard location of /usr/lib/jni for libraries to be used from Java. However, the Oracle JVM does not currently look in this location. The easiest way to tell Java where to find the JavaHL library is to specify the following when starting the JVM:

-Djava.library.path=</path/to/library> 

Example:

-Djava.library.path=/usr/lib/jni 

CollabNet Subversion installs into /opt/CollabNet_Subversion. So if you are using that package, you need this:

-Djava.library.path=/opt/CollabNet_Subversion/lib 

Eclipse provides its own mechanism for providing this setting. Eclipse comes with a file named eclipse.ini. This file is looked at when the Eclipse launcher starts the JVM and appends settings to the JVM when launching it. Specifically, you should see a line that says "-vmargs". Add a newline after this line and insert the above line to pass the setting the JVM needs. Each argument needs to be on its own line, so be sure to add a new line and then put the entire string above on its own line. Here is an example of this file from Eclipse 3.4:

-showsplash org.eclipse.platform -framework plugins/org.eclipse.osgi_3.4.0.v20080605-1900.jar -vmargs -Djava.library.path=/opt/CollabNet_Subversion/lib -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m -XX:MaxPermSize=256m
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值