目录
一、编译环境
二、编译出现的问题
三、解决方法
1、删除homebrew目录下面的homebrew-cask 和homebrew-core ,重新下载这两个部分。
2、设置清华的homebrew源
四、编译server模式的 hotspot??jvm
一、编译环境
macOS bigSur 11.5+Xcode +command Line tools?
openjdk12 源码zip包:https://hg.openjdk.java.net/jdk/jdk12/file/06222165c35f
二、编译出现的问题
Error: git: Calling `sha256 "digest" => :tag` in a bottle block is disabled!
Error: git: Calling `sha256 "digest" => :tag` in a bottle block is disabled! Use `brew style --fix` on the formula to update the style or use `sha256 tag: "digest"` instead.
Please report this issue to the homebrew/core tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git.rb:9
Error: autoconf: Calling `cellar` in a bottle block is disabled!
brew install autoconf
Error: autoconf: Calling `cellar` in a bottle block is disabled! Use `brew style --fix` on the formula to update the style or use `sha256` with a `cellar:` argument instead.
Please report this issue to the homebrew/core tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/autoconf.rb:9
Error: ? homebrew-core is a shallow clone. ? homebrew-cask is a shallow clone. To `brew update`, first run: ? git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow ? git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
Error:
homebrew-core is a shallow clone.
homebrew-cask is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
mbp-4:~ storm$ git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header
mbp-4:~ storm$ git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
三、解决方法
1、删除homebrew目录下面的homebrew-cask 和homebrew-core ,重新下载这两个部分。
2、设置清华的homebrew源
mbp-4:homebrew-core storm$ cd /usr/local/Homebrew/Library/Taps/
mbp-4:Taps storm$ pwd
/usr/local/Homebrew/Library/Taps
mbp-4:Taps storm$ ls
homebrew
mbp-4:Taps storm$ cd homebrew/
--重新安装homebrew-core
mbp-4:homebrew storm$ rm -rf homebrew-core/
mbp-4:homebrew storm$ ls
homebrew-cask homebrew-services
mbp-4:homebrew storm$ git clone https://mirrors.ustc.edu.cn/homebrew-core.git
Cloning into 'homebrew-core'...
remote: Enumerating objects: 1008147, done.
remote: Total 1008147 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (1008147/1008147), 405.45 MiB | 9.16 MiB/s, done.
Resolving deltas: 100% (695922/695922), done.
--重新安装homebrew-cask
mbp-4:homebrew storm$ rm -rf homebrew-cask/
mbp-4:homebrew storm$ git clone https://mirrors.ustc.edu.cn/homebrew-cask.git/
Cloning into 'homebrew-cask'...
remote: Enumerating objects: 635551, done.
remote: Total 635551 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (635551/635551), 266.62 MiB | 8.33 MiB/s, done.
Resolving deltas: 100% (454033/454033), done.
mbp-4:homebrew storm$ ls
homebrew-cask homebrew-core homebrew-services
Already up-to-date.
---设置清华的homebrew源
mbp-4:Homebrew storm$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
--brew update 更新设置
mbp-4:homebrew storm$ brew update
==> Homebrew has enabled anonymous aggregate formula and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics have been recorded yet (nor will be during this `brew` run).
mbp-4:Homebrew storm$ git remote get-url origin
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
--安装autoconf
mbp-4:Homebrew storm$ brew install autoconf
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/m4-1.4.18.b
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/autoconf-2.
######################################################################## 100.0%
==> Installing dependencies for autoconf: m4
==> Installing autoconf dependency: m4
==> Pouring m4-1.4.18.big_sur.bottle.1.tar.gz
🍺 /usr/local/Cellar/m4/1.4.18: 13 files, 672.3KB
==> Installing autoconf
==> Pouring autoconf-2.71.big_sur.bottle.tar.gz
🍺 /usr/local/Cellar/autoconf/2.71: 71 files, 3.2MB
四、编译server模式的 hotspot??jvm
mbp-4:Downloads storm$ cd jdk12-06222165c35f mbp-4:jdk12-06222165c35f storm$ bash configure --enable-debug --with-jvm-variants=server
configure: (Your Boot JDK version must be one of: 11 12)
configure: Found potential Boot JDK using well-known locations (in /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk)
configure: Potential Boot JDK found at /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home is incorrect JDK version (java version "1.7.0_79"); ignoring
configure: (Your Boot JDK version must be one of: 11 12)
configure: Could not find a valid Boot JDK. You might be able to fix this by running 'brew cask install java'.
configure: This might be fixed by explicitly setting --with-boot-jdk
configure: error: Cannot continue
/Users/storm/Downloads/jdk12-06222165c35f/build/.configure-support/generated-configure.sh: line 84: 5: Bad file descriptor
configure exiting with result code 1
在周志明《深入理解java虚拟机 JVM高级特性与最佳实践 第三版》这本书中,用的是openJDK11.0.3做的默认的jdk,我电脑里只有jdk1.7 和jdk1.8,我下载一个 jdk11.0.12,再次编译成功。
====================================================
A new configuration has been successfully created in
/Users/storm/Downloads/jdk12-06222165c35f/build/macosx-x86_64-server-fastdebug
using configure arguments '--enable-debug --with-jvm-variants=server'.
Configuration summary:
* Debug level: fastdebug
* HS debug level: fastdebug
* JVM variants: server
* JVM features: server: 'aot cds cmsgc compiler1 compiler2 dtrace epsilongc g1gc graal jfr jni-check jvmci jvmti management nmt parallelgc serialgc services shenandoahgc vm-structs'
* OpenJDK target: OS: macosx, CPU architecture: x86, address length: 64
* Version string: 12-internal+0-adhoc.storm.jdk12-06222165c35f (12-internal)
Tools summary:
* Boot JDK: java version "11.0.12" 2021-07-20 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode) (at /Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home)
* Toolchain: clang (clang/LLVM from Xcode 12.5.1)
* C Compiler: Version 12.0.5 (at /usr/bin/clang)
* C++ Compiler: Version 12.0.5 (at /usr/bin/clang++)
Build performance summary:
* Cores to use: 8
* Memory limit: 16384 MB
|