mac下安装javaHL not available的解决办法

在Mac下安装Eclipse插件svnEclipse插件后,每次打开Eclipse都会弹出如下弹出框:

mac下安装javaHL not available的解决办法_第1张图片

提示你本机缺少JavaHL Library。

选择Eclipse→偏好设置(preference)→Team→SVN,可以看到SVN接口Client的定义如下:

这说明当前系统中缺少JavaHL,需要我们手动安装。

subeclipse官网(http://subclipse.tigris.org/wiki/JavaHL 打开可能会非常慢)给出的介绍说有两种方式可以在Mac电脑上(OS X)上安装JavaHL Library,一种是通过MacPort,一种是通过HomeBrew的形式。如图所示:

这里我们主要介绍使用HomeBrew实行安装。

步骤1:安装HomeBrew:

HomeBrew的安装需要依赖XCode和Commond Line,具体的安装步骤如下:

1、安装Xcode
2、安装command line tools,打开终端,输入命令:
         xcode-select  - - install  这样mac 10.9以后的系统会安装command line tools
3、安装brew ,打开终端,输入命令:
        curl -LsSf  http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1
4、更新brew ,打开终端,输入命令:(可忽略)
         brew update
5、诊断系统 ,打开终端,输入命令:(可忽略)
         brew doctor

HomeBrew的安装过程介绍网上也有很多教程,比如:

http://brew.sh/    --官网

http://www.jb51.net/os/MAC/101860.html    

http://www.cnblogs.com/liulipeng/p/3938518.html

就不更多介绍了,如果安装过程遇到了问题,百度下基本都能解决的。

 

步骤2:执行命令,安装JavaHL

进入终端,键入如下命令:

brew install --universal --java subversion

但是会遇到如下问题,提示有个包下不到,原因你懂得,被墙了。

复制代码
==> Downloading https://www.apache.org/dyn/closer.cgi?path=subversion/subversion
Already downloaded: /Library/Caches/Homebrew/subversion-1.8.13.tar.bz2
==> Patching
patching file configure
Hunk #1 succeeded at 25386 (offset 20 lines).
patching file subversion/bindings/swig/perl/native/Makefile.PL.in
==> Downloading https://serf.googlecode.com/svn/src_releases/serf-1.3.8.tar.bz2

curl: (7) Failed to connect to serf.googlecode.com port 443: Operation timed out
Error: Failed to download resource "subversion--serf"
Download failed: https://serf.googlecode.com/svn/src_releases/serf-1.3.8.tar.bz2
复制代码

这个问题也有解决的办法,那就是下载对应的包,放在对应的目录下,这样就能再安装JavaHL的过程中跳过serf-1.3.8.tar.bz2的下载了。

步骤2.1:下载serf-1.3.8.tar.bz2包:

http://download.csdn.net/detail/shanwenchao/8653245

下载后放在任意目录,将名称修改为:subversion--serf-1.3.7.tar.bz2

 

步骤2.2:将改名后的该文件放在目录下:

将修改后的文件放在/Library/Caches/Homebrew目录下。

 

步骤2.3:重新执行安装命令,安装JavaHL:

brew install --universal --java subversion

这是就不会下载而是直接从文件目录中取该包了。如下过程:

复制代码
 brew install --universal --java subversion
Warning: subversion: --java was deprecated; using --with-java instead!
==> Downloading https://www.apache.org/dyn/closer.cgi?path=subversion/subversion
Already downloaded: /Library/Caches/Homebrew/subversion-1.8.13.tar.bz2
==> Patching
patching file configure
Hunk #1 succeeded at 25386 (offset 20 lines).
patching file subversion/bindings/swig/perl/native/Makefile.PL.in
==> Downloading https://serf.googlecode.com/svn/src_releases/serf-1.3.8.tar.bz2
Already downloaded: /Library/Caches/Homebrew/subversion--serf-1.3.8.tar.bz2
==> /usr/local/opt/scons/bin/scons PREFIX=/usr/local/Cellar/subversion/1.8.13/li
==> /usr/local/opt/scons/bin/scons install
==> ./configure --prefix=/usr/local/Cellar/subversion/1.8.13 --with-zlib=/usr --with-sqlite=/usr/local/opt/sqlite --with-serf=/usr/local/Cellar/subversion/1.8.13/libexec/serf --disa
==> make
==> make install
==> make tools
==> make install-tools
==> make javahl
==> make install-javahl
==> Caveats
svntools have been installed to:
  /usr/local/opt/subversion/libexec

You may need to link the Java bindings into the Java Extensions folder:
  sudo mkdir -p /Library/Java/Extensions
  sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary

你可能感兴趣的:(java基础)