You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
@@ -118,10 +116,10 @@ <h1 class="title">Building the JDK</h1>
118
116
</ul>
119
117
</nav>
120
118
<h2id="tldr-instructions-for-the-impatient">TL;DR (Instructions for the Impatient)</h2>
121
-
<p>If you are eager to try out building the JDK, these simple steps works most of the time. They assume that you have installed Mercurial (and Cygwin if running on Windows) and cloned the top-level JDK repository that you want to build.</p>
119
+
<p>If you are eager to try out building the JDK, these simple steps works most of the time. They assume that you have installed Git (and Cygwin if running on Windows) and cloned the top-level JDK repository that you want to build.</p>
122
120
<oltype="1">
123
121
<li><p><ahref="#getting-the-source-code">Get the complete source code</a>:<br/>
<p>If <code>configure</code> fails due to missing dependencies (to either the <ahref="#native-compiler-toolchain-requirements">toolchain</a>, <ahref="#build-tools-requirements">build tools</a>, <ahref="#external-library-requirements">external libraries</a> or the <ahref="#boot-jdk-requirements">boot JDK</a>), most of the time it prints a suggestion on how to resolve the situation on your platform. Follow the instructions, and try running <code>bash configure</code> again.</p></li>
<p>The JDK is a complex software project. Building it requires a certain amount of technical expertise, a fair number of dependencies on external software, and reasonably powerful hardware.</p>
138
136
<p>If you just want to use the JDK and not build it yourself, this document is not for you. See for instance <ahref="http://openjdk.java.net/install">OpenJDK installation</a> for some methods of installing a prebuilt JDK.</p>
139
137
<h2id="getting-the-source-code">Getting the Source Code</h2>
140
-
<p>Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single repository. At the <ahref="http://hg.openjdk.java.net/">OpenJDK Mercurial server</a> you can see a list of all available repositories. If you want to build an older version, e.g. JDK 8, it is recommended that you get the <code>jdk8u</code>forest, which contains incremental updates, instead of the <code>jdk8</code>forest, which was frozen at JDK 8 GA.</p>
141
-
<p>If you are new to Mercurial, a good place to start is the <ahref="http://www.mercurial-scm.org/guide">Mercurial Beginner's Guide</a>. The rest of this document assumes a working knowledge of Mercurial.</p>
138
+
<p>Make sure you are getting the correct version. As of JDK 10, the source is no longer split into separate repositories so you only need to clone one single repository. At the <ahref="https://git.openjdk.java.net/">OpenJDK Git site</a> you can see a list of all available repositories. If you want to build an older version, e.g. JDK 11, it is recommended that you get the <code>jdk11u</code>repo, which contains incremental updates, instead of the <code>jdk11</code>repo, which was frozen at JDK 11 GA.</p>
139
+
<p>If you are new to Git, a good place to start is the book <ahref="https://git-scm.com/book/en/v2">Pro Git</a>. The rest of this document assumes a working knowledge of Git.</p>
<li><p>Create the directory that is going to contain the top directory of the JDK clone by using the <code>mkdir</code> command in the Cygwin bash shell. That is, do <em>not</em> create it using Windows Explorer. This will ensure that it will have proper Cygwin attributes, and that it's children will inherit those attributes.</p></li>
151
149
<li><p>Do not put the JDK clone in a path under your Cygwin home directory. This is especially important if your user name contains spaces and/or mixed upper and lower case letters.</p></li>
152
-
<li><p>Clone the JDK repository using the Cygwin command line <code>hg</code> client as instructed in this document. That is, do <em>not</em> use another Mercurial client such as TortoiseHg.</p></li>
150
+
<li><p>You need to install a git client. You have two choices, Cygwin git or Git for Windows. Unfortunately there are pros and cons with each choice.</p>
151
+
<ul>
152
+
<li><p>The Cygwin <code>git</code> client has no line ending issues and understands Cygwin paths (which are used throughout the JDK build system). However, it does not currently work well with the Skara CLI tooling. Please see the <ahref="https://wiki.openjdk.java.net/display/SKARA/Skara#Skara-Git">Skara wiki on Git clients</a> for up-to-date information about the Skara git client support.</p></li>
153
+
<li><p>The <ahref="https://gitforwindows.org">Git for Windows</a> client has issues with line endings, and do not understand Cygwin paths. It does work well with the Skara CLI tooling, however. To alleviate the line ending problems, make sure you set <code>core.autocrlf</code> to <code>false</code> (this is asked during installation).</p></li>
154
+
</ul></li>
153
155
</ul>
154
156
<p>Failure to follow this procedure might result in hard-to-debug build problems.</p></li>
155
157
</ul>
@@ -202,7 +204,7 @@ <h3 id="windows">Windows</h3>
202
204
<p>Windows XP is not a supported platform, but all newer Windows should be able to build the JDK.</p>
203
205
<p>On Windows, it is important that you pay attention to the instructions in the <ahref="#special-considerations">Special Considerations</a>.</p>
204
206
<p>Windows is the only non-POSIX OS supported by the JDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. Currently, the only supported such layers are Cygwin and Windows Subsystem for Linux (WSL). (Msys is no longer supported due to a too old bash; msys2 would likely be possible to support in a future version but that would require effort to implement.)</p>
205
-
<p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/hg/jdk9/Makefile</code> rather than <code>C:\hg\jdk9\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-msvcr-dll=/cygdrive/c/msvcr100.dll</code> rather than <code>--with-msvcr-dll=c:\msvcr100.dll</code>. For details on this conversion, see the section on <ahref="#fixpath">Fixpath</a>.</p>
207
+
<p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/git/jdk/Makefile</code> rather than <code>C:\git\jdk\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-msvcr-dll=/cygdrive/c/msvcr100.dll</code> rather than <code>--with-msvcr-dll=c:\msvcr100.dll</code>. For details on this conversion, see the section on <ahref="#fixpath">Fixpath</a>.</p>
206
208
<h4id="cygwin">Cygwin</h4>
207
209
<p>A functioning <ahref="http://www.cygwin.com/">Cygwin</a> environment is required for building the JDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.</p>
208
210
<p><strong>Note:</strong> Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the JDK build process, and that can cause unexpected build problems.</p>
@@ -572,7 +574,6 @@ <h4 id="advanced-make-control-variables">Advanced Make Control Variables</h4>
572
574
<li><code>CONF_CHECK</code></li>
573
575
<li><code>COMPARE_BUILD</code></li>
574
576
<li><code>JDK_FILTER</code></li>
575
-
<li><code>SPEC_FILTER</code></li>
576
577
</ul>
577
578
<h2id="running-tests">Running Tests</h2>
578
579
<p>Most of the JDK tests are using the <ahref="http://openjdk.java.net/jtreg">JTReg</a> test framework. Make sure that your configuration knows where to find your installation of JTReg. If this is not picked up automatically, use the <code>--with-jtreg=<path to jtreg home></code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc.</p>
=== Output from failing command(s) repeated here ===
816
817
* For target hotspot_variant-server_libjvm_objs_psMemoryPool.o:
817
-
/localhome/hg/jdk9-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
818
+
/localhome/git/jdk-sandbox/hotspot/src/share/vm/services/psMemoryPool.cpp:1:1: error: 'failhere' does not name a type
818
819
... (rest of output omitted)
819
820
820
-
* All command lines available in /localhome/hg/jdk9-sandbox/build/linux-x64/make-support/failure-logs.
821
+
* All command lines available in /localhome/git/jdk-sandbox/build/linux-x64/make-support/failure-logs.
821
822
=== End of repeated output ===
822
823
823
824
=== Make failed targets repeated here ===
824
-
lib/CompileJvm.gmk:207: recipe for target '/localhome/hg/jdk9-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed
825
+
lib/CompileJvm.gmk:207: recipe for target '/localhome/git/jdk-sandbox/build/linux-x64/hotspot/variant-server/libjvm/objs/psMemoryPool.o' failed
825
826
make/Main.gmk:263: recipe for target 'hotspot-server-libs' failed
826
827
=== End of repeated output ===
827
828
@@ -848,7 +849,7 @@ <h4 id="problems-with-incremental-rebuilds">Problems with Incremental Rebuilds</
848
849
<p>Here are a suggested list of things to try if you are having unexpected build problems. Each step requires more time than the one before, so try them in order. Most issues will be solved at step 1 or 2.</p>
849
850
<oltype="1">
850
851
<li><p>Make sure your repository is up-to-date</p>
851
-
<p>Run <code>hg pull -u</code> to make sure you have the latest changes.</p></li>
852
+
<p>Run <code>git pull origin master</code> to make sure you have the latest changes.</p></li>
852
853
<li><p>Clean build results</p>
853
854
<p>The simplest way to fix incremental rebuild issues is to run <code>make clean</code>. This will remove all build results, but not the configuration or any build system support artifacts. In most cases, this will solve build errors resulting from incremental build mismatches.</p></li>
854
855
<li><p>Completely clean the build directory.</p>
@@ -857,8 +858,8 @@ <h4 id="problems-with-incremental-rebuilds">Problems with Incremental Rebuilds</
857
858
make dist-clean
858
859
bash configure $(cat current-configuration)
859
860
make</code></pre></li>
860
-
<li><p>Re-clone the Mercurial repository</p>
861
-
<p>Sometimes the Mercurial repository gets in a state that causes the product to be un-buildable. In such a case, the simplest solution is often the "sledgehammer approach": delete the entire repository, and re-clone it. If you have local changes, save them first to a different location using <code>hg export</code>.</p></li>
861
+
<li><p>Re-clone the Git repository</p>
862
+
<p>Sometimes the Git repository gets in a state that causes the product to be un-buildable. In such a case, the simplest solution is often the "sledgehammer approach": delete the entire repository, and re-clone it. If you have local changes, save them first to a different location using <code>git format-patch</code>.</p></li>
<p>If none of the suggestions in this document helps you, or if you find what you believe is a bug in the build system, please contact the Build Group by sending a mail to <ahref="mailto:[email protected]">[email protected]</a>. Please include the relevant parts of the configure and/or build log.</p>
881
882
<p>If you need general help or advice about developing for the JDK, you can also contact the Adoption Group. See the section on <ahref="#contributing-to-openjdk">Contributing to OpenJDK</a> for more information.</p>
882
883
<h2id="hints-and-suggestions-for-advanced-users">Hints and Suggestions for Advanced Users</h2>
883
-
<h3id="setting-up-a-repository-for-pushing-changes-defpath">Setting Up a Repository for Pushing Changes (defpath)</h3>
884
-
<p>To help you prepare a proper push path for a Mercurial repository, there exists a useful tool known as <ahref="http://openjdk.java.net/projects/code-tools/defpath">defpath</a>. It will help you setup a proper push path for pushing changes to the JDK.</p>
885
-
<p>Install the extension by cloning <code>http://hg.openjdk.java.net/code-tools/defpath</code> and updating your <code>.hgrc</code> file. Here's one way to do this:</p>
<p>The <code>configure</code> and <code>make</code> commands tries to play nice with bash command-line completion (using <code><tab></code> or <code><tab><tab></code>). To use this functionality, make sure you enable completion in your <code>~/.bashrc</code> (see instructions for bash in your operating system).</p>
898
886
<p>Make completion will work out of the box, and will complete valid make targets. For instance, typing <code>make jdk-i<tab></code> will complete to <code>make jdk-image</code>.</p>
@@ -946,14 +934,6 @@ <h4 id="skipping-the-dependency-check">Skipping the Dependency Check</h4>
946
934
<h4id="rebuilding-part-of-java.base-jdk_filter">Rebuilding Part of java.base (JDK_FILTER)</h4>
947
935
<p>If you are modifying files in <code>java.base</code>, which is the by far largest module in the JDK, then you need to rebuild all those files whenever a single file has changed. (This inefficiency will hopefully be addressed in JDK 10.)</p>
948
936
<p>As a hack, you can use the make control variable <code>JDK_FILTER</code> to specify a pattern that will be used to limit the set of files being recompiled. For instance, <code>make java.base JDK_FILTER=javax/crypto</code> (or, to combine methods, <code>make java.base-java-only JDK_FILTER=javax/crypto</code>) will limit the compilation to files in the <code>javax.crypto</code> package.</p>
949
-
<h3id="learn-about-mercurial">Learn About Mercurial</h3>
950
-
<p>To become an efficient JDK developer, it is recommended that you invest in learning Mercurial properly. Here are some links that can get you started:</p>
951
-
<ul>
952
-
<li><ahref="http://www.mercurial-scm.org/wiki/GitConcepts">Mercurial for git users</a></li>
953
-
<li><ahref="http://www.mercurial-scm.org/wiki/Tutorial">The official Mercurial tutorial</a></li>
954
-
<li><ahref="http://hginit.com/">hg init</a></li>
955
-
<li><ahref="http://hgbook.red-bean.com/read/">Mercurial: The Definitive Guide</a></li>
956
-
</ul>
957
937
<h2id="understanding-the-build-system">Understanding the Build System</h2>
958
938
<p>This section will give you a more technical description on the details of the build system.</p>
0 commit comments