t.marcusの外部記憶装置

忘備録とかちょっとした考えとかをつらつらと...

Mac + Eclipse + Subclipseの環境構築

EclipseSubclipseを使うときにSubversion Native Library Not Availableって怒られるので、それの解決方法に関して書いておきます。

基本的にはkawa_xxxさんの記事の通り
http://d.hatena.ne.jp/kawa_xxx/20110930/1317381845

環境

1.Subclipse拡張をインストール
Eclipse Market Placeを開いて「Subclipse」で検索してInstall。

2.subversionライブラリをインストール
ライブラリ見つからないよって怒られるので、brewでインストール

$ brew install --universal --java subversion

3.Eclipsejava.library.pathに追加
kawa_xxxさんの記事では、/usr/local/lib/libsvnjavahl-1.dylibを/Library/Java/Extensionsにシンボリックリンクを張っているが、私の環境ではそれで動かなかった。

[tmarcus@MarcusMBP15 ~]$ brew install --universal --java subversion
==> Installing subversion dependency: neon
==> Downloading http://www.webdav.org/neon/neon-0.29.6.tar.gz
Already downloaded: /Library/Caches/Homebrew/neon-0.29.6.tar.gz
==> ./configure --prefix=/usr/local/Cellar/neon/0.29.6 --enable-shared --disable-static --with-ssl
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Compiling newer versions of Subversion on 10.6 require this newer neon.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/neon/lib
    CPPFLAGS: -I/usr/local/opt/neon/include

==> Summary
/usr/local/Cellar/neon/0.29.6: 172 files, 1.4M, built in 16 seconds
==> Installing subversion dependency: sqlite
==> Downloading http://sqlite.org/sqlite-autoconf-3071400.tar.gz
Already downloaded: /Library/Caches/Homebrew/sqlite-3.7.14.tar.gz
==> ./configure --prefix=/usr/local/Cellar/sqlite/3.7.14 --enable-dynamic-extensions
==> make install
/usr/local/Cellar/sqlite/3.7.14: 9 files, 3.2M, built in 45 seconds
==> Installing subversion dependency: serf
==> Downloading http://serf.googlecode.com/files/serf-1.1.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/serf-1.1.0.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/serf/1.1.0 --with-apr=/usr/local/Library/ENV/4.3
==> make install
/usr/local/Cellar/serf/1.1.0: 11 files, 504K, built in 7 seconds
==> Installing subversion
==> Downloading http://www.apache.org/dyn/closer.cgi?path=subversion/subversion-1.7.6.tar.bz2
Already downloaded: /Library/Caches/Homebrew/subversion-1.7.6.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/subversion/1.7.6 --with-ssl --with-zlib=/usr --with-sqlite=/usr/local --with-serf=/usr/lo
==> make
==> make install
==> make javahl
==> make install-javahl
==> Caveats
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

==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
/usr/local/Cellar/subversion/1.7.6: 99 files, 14M, built in 3.1 minutes

brewでのインストール先が違う模様なので(最後の手順も変、、、)、eclipse.iniに直接パスを指定する。
ダイアログに書かれてるパスをメモって、そこにインストールディレクトリを追加して、VMの起動オプションに追加する

ダイアログに書かれてるパス)
java.library.path=.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

eclipse.iniに追記するオプション)
-Djava.library.path=.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:/usr/local/Cellar/subversion/1.7.6/lib

私の環境では、これで動きました。