0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mac(Sierra)にOpenJDK8をインストールしようとして断念するまで

Posted at

次のサイトを参考に作業開始。
https://github.com/hgomez/obuildfactory/wiki/Building-and-Packaging-OpenJDK8-for-OSX

準備で/usr/include/X11 をmkdirする際にsudoでも権限エラーになったので下記手順で設定変更したら作成できた。
http://berukann.hatenablog.jp/entry/2015/12/30/123020

mkdir ~/openjdk8build
cd ~/openjdk8build
git clone https://github.com/hgomez/obuildfactory.git 
XUSE_NEW_BUILD_SYSTEM=true XBUILD=true ./obuildfactory/openjdk8/macosx/standalone-job.sh 

build fail してしまい原因がわからないので

rm -rf ~/openjdk8build/*

してから下記手順に変更。
https://github.com/manasthakur/jdk-tips/wiki/Building-OpenJDK-8-on-Mac-OS-X-Yosemite

既にXCodeをインストール済みなので一旦退避してから古い4.6.3をインストールする。

sudo mv /Applications/Xcode.app /Applications/Xcode.app_bk

で退避したあとダウンロードしたインストーラを実行してから

sudo mv /Applications/Xcode.app /Applications/Xcode4/

して退避していたのを戻す。

sudo mv /Applications/Xcode.app_bk /Applications/Xcode.app

hgが入ってなかったので

brew install mercurial

したら下記エラー。

Homebrew must be run under Ruby 2.3! You're running 2.0.0. (RuntimeError)

ので新しいRubyをrbenvで入れる。(rbenvも入ってなかったのでインストールした)

brew update
brew install ruby-build
brew install rbenv
rbenv install 2.4.2

再び brew install mercurial で成功。

cd ~/openjdk8build
hg clone http://hg.openjdk.java.net/jdk8u/jdk8u-dev/ jdk8
cd ~/openjdk8build/jdk8
bash get_source.sh
chmod u+x configure
./configure

Xcodeが4じゃないよエラーになったので利用するXcodeを変更

sudo xcode-select -switch /Applications/Xcode4/Xcode.app/Contents/Developer

再び

./configure
bash configure --with-xcode-path=/Applications/Xcode4/Xcode.app

すると次のエラー。

checking for xcodebuild... /usr/bin/xcodebuild
dyld: Library not loaded: @rpath/DVTFoundation.framework/Versions/A/DVTFoundation
  Referenced from: /Applications/Xcode4/Xcode.app/Contents/Developer/usr/bin/xcodebuild
  Reason: no suitable image found.  Did find:
  /Applications/Xcode4/Xcode.app/Contents/Developer/usr/bin/../../../SharedFrameworks/DVTFoundation.framework/Versions/A/DVTFoundation: cannot load '/Applications/Xcode4/Xcode.app/Contents/Developer/usr/bin/../../../SharedFrameworks/DVTFoundation.framework/Versions/A/DVTFoundation' because Objective-C garbage collection is not supported
xcrun: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
xcrun: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
configure: error: Xcode 4 is required to build JDK 8, the version found was . Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select.
configure exiting with result code 1

よくわからない。。最初にうまくいかなかった方の記事
https://github.com/hgomez/obuildfactory/wiki/Building-and-Packaging-OpenJDK8-for-OSX
にはCommand Line Toolsがインストールされていることが条件にあるので入れてみる。
https://stangler.blogspot.jp/2017/02/macos-sierra-xcode-command-line-tools_14.html
の手順で、Sierra(10.12)のXcode9.0.1用のCommand Line Toolsを入手してインストールして再び

bash configure --with-xcode-path=/Applications/Xcode4/Xcode.app

するが状況変わらず。

sudo xcode-select -switch /Applications/Xcode4/Xcode.app
bash ./configure

でも変わらず。
ここで断念。

ちなみにエラーメッセージ中にある DVTFoundation とやらは、つぎのとおり存在している。

$ ll /Applications/Xcode4/Xcode.app/Contents/Developer/usr/bin/../../../SharedFrameworks/DVTFoundation.framework/Versions/A/DVTFoundation
   inode Permissions Links  Size Blocks User Group Date Modified Name
27834122 .rwxr-xr-x@     1 4.1Mi   1928 taro admin 10 6  2013    /Applications/Xcode4/Xcode.app/Contents/Developer/usr/bin/../../../SharedFrameworks/DVTFoundation.framework/Versions/A/DVTFoundation
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?