Build OpenJDK9 on MacOS Sierra

Source: Internet
Author: User
Tags deprecated

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 a 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 have 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 the 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_toolsstoppin G 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.