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?

OpenJDKのコンパイル (MacOS)

0
Posted at

OpenJDKはオープンソースということで、ソードコードの取得とコンパイルを試しました。
メモを残しておきます。

MacOS Tahoe 26.2
M1 CPU

  1. 作業ディレクトリを作る。
    mkdir /Users/user01/java

  2. JTREGをインストールする。
    2.1 現在のJDKホームを探す。
    /usr/libexec/java_home -V
    --> /Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Home

2.2 JTREGをダウンロード・インストール
cd /Users/user01/java
git clone https://github.com/openjdk/jtreg.git
cd jtreg
sh make/build.sh --jdk /Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Home

--> ビルドの結果 : /Users/user01/java/jtreg/build/images/jtreg

  1. JDKのダウンロードとインストール

3.1 ルートディレクトリに切り替える
cd /Users/user01/java

3.2 JT_HOME環境変数
export JT_HOME=/Users/user01/java/jtreg/build/images/jtreg

3.3 ソースコードをダウンロード
git clone https://git.openjdk.org/jdk

3.4 jdkディレクトリへ移動
cd jdk

3.5 configure
chmod u+x configure
./configure --with-jtreg=$JT_HOME

3.6 Make images
make images

#長時間のコンパイルが続きます。

3.7 結果を確認します。
build/macosx-aarch64-server-release/images/jdk/bin/java -version
--> openjdk version "27-internal" 2026-09-15

3.8 テスト
make test-tier1

長時間(1時間以上)かかりました。


   TEST                            TOTAL  PASS  FAIL ERROR  SKIP   
   jtreg:test/hotspot/jtreg:tier1  3202  2807    25     0   370 
   jtreg:test/jdk:tier1            2557  2502     2     0    53 
   jtreg:test/langtools:tier1      4690  2916  1761     3    10 
   jtreg:test/jaxp:tier1              0     0     0     0     0   
   jtreg:test/lib-test:tier1         38    38     0     0     0   

以上です。

参考資料:
https://qiita.com/tabatad/items/89604c1bd018c5999030
https://github.com/openjdk/jtreg
https://github.com/openjdk/jdk/blob/master/doc/building.md

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?