首页 > 代码库 > Build OpenJDK9 on macOS Sierra
Build OpenJDK9 on macOS Sierra
1. Get the source code:
hg clone http://hg.openjdk.java.net/jdk9/jdk9 jdk9cd jdk9sh get_source.sh
It may fail due to GFW. One alternative solution is fetching the code on an abroad VPS.
2. Build OpenJDK9
The gcc command has been used by macOS clang。
$ gcc --versionConfigured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1Apple LLVM version 8.1.0 (clang-802.0.42)Target: x86_64-apple-darwin16.6.0Thread model: posixInstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
The configure command:
./configure --with-freetype=/usr/local/Cellar/freetype/2.8 --enable-debug --with-target-bits=64 --disable-warnings-as-errors
--with-freetype=/usr/local/Cellar/freetype/2.8
Though freetype is installed via
brew intall freetype
But script configure cannot find it by default. The freetype prefix has to be specified explicitly.
--disable-warnings-as-errors
To skip compiling error in [1]:
instantiation of variable ‘TreeChunk<Metachunk, FreeList<Metachunk> >::_min_tree_chunk_size‘ required here, but no definition is available [-Wundefined-var-template] return _min_tree_chunk_size; ^
It‘s kind of exciting to see the following messages after so much struggling.
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]Compiling 4 files for BUILD_JIGSAW_TOOLSStopping sjavac serverFinished building target ‘default (exploded-image)‘ in configuration ‘macosx-x86_64-normal-server-fastdebug‘
The version info of new build java:
$ bin/java --versionopenjdk 9-internalOpenJDK Runtime Environment (fastdebug build 9-internal+0-adhoc.Hu.jdk9)OpenJDK 64-Bit Server VM (fastdebug build 9-internal+0-adhoc.Hu.jdk9, mixed mode)
Reference:
[1] http://mail.openjdk.java.net/pipermail/build-dev/2017-May.txt
Build OpenJDK9 on macOS Sierra
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。