33030
|
1 |
![OpenJDK](http://openjdk.java.net/images/openjdk.png)
|
|
2 |
# OpenJDK Build README
|
|
3 |
|
|
4 |
*****
|
|
5 |
|
|
6 |
<a name="introduction"></a>
|
|
7 |
## Introduction
|
|
8 |
|
|
9 |
This README file contains build instructions for the
|
|
10 |
[OpenJDK](http://openjdk.java.net). Building the source code for the OpenJDK
|
|
11 |
requires a certain degree of technical expertise.
|
|
12 |
|
|
13 |
### !!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!
|
|
14 |
|
|
15 |
Some Headlines:
|
|
16 |
|
|
17 |
* The build is now a "`configure && make`" style build
|
|
18 |
* Any GNU make 3.81 or newer should work, except on Windows where 4.0 or newer
|
|
19 |
is recommended.
|
|
20 |
* The build should scale, i.e. more processors should cause the build to be
|
|
21 |
done in less wall-clock time
|
|
22 |
* Nested or recursive make invocations have been significantly reduced,
|
|
23 |
as has the total fork/exec or spawning of sub processes during the build
|
|
24 |
* Windows MKS usage is no longer supported
|
|
25 |
* Windows Visual Studio `vsvars*.bat` and `vcvars*.bat` files are run
|
|
26 |
automatically
|
|
27 |
* Ant is no longer used when building the OpenJDK
|
|
28 |
* Use of ALT_* environment variables for configuring the build is no longer
|
|
29 |
supported
|
|
30 |
|
|
31 |
*****
|
|
32 |
|
|
33 |
## Contents
|
|
34 |
|
|
35 |
* [Introduction](#introduction)
|
|
36 |
* [Use of Mercurial](#hg)
|
|
37 |
* [Getting the Source](#get_source)
|
|
38 |
* [Repositories](#repositories)
|
|
39 |
* [Building](#building)
|
|
40 |
* [System Setup](#setup)
|
|
41 |
* [Linux](#linux)
|
|
42 |
* [Solaris](#solaris)
|
|
43 |
* [Mac OS X](#macosx)
|
|
44 |
* [Windows](#windows)
|
|
45 |
* [Configure](#configure)
|
|
46 |
* [Make](#make)
|
|
47 |
* [Testing](#testing)
|
|
48 |
|
|
49 |
*****
|
|
50 |
|
|
51 |
* [Appendix A: Hints and Tips](#hints)
|
|
52 |
* [FAQ](#faq)
|
|
53 |
* [Build Performance Tips](#performance)
|
|
54 |
* [Troubleshooting](#troubleshooting)
|
|
55 |
* [Appendix B: GNU Make Information](#gmake)
|
|
56 |
* [Appendix C: Build Environments](#buildenvironments)
|
|
57 |
|
|
58 |
*****
|
|
59 |
|
|
60 |
<a name="hg"></a>
|
|
61 |
## Use of Mercurial
|
|
62 |
|
|
63 |
The OpenJDK sources are maintained with the revision control system
|
|
64 |
[Mercurial](http://mercurial.selenic.com/wiki/Mercurial). If you are new to
|
|
65 |
Mercurial, please see the [Beginner Guides](http://mercurial.selenic.com/wiki/
|
|
66 |
BeginnersGuides) or refer to the [Mercurial Book](http://hgbook.red-bean.com/).
|
|
67 |
The first few chapters of the book provide an excellent overview of Mercurial,
|
|
68 |
what it is and how it works.
|
|
69 |
|
|
70 |
For using Mercurial with the OpenJDK refer to the [Developer Guide: Installing
|
|
71 |
and Configuring Mercurial](http://openjdk.java.net/guide/
|
|
72 |
repositories.html#installConfig) section for more information.
|
|
73 |
|
|
74 |
<a name="get_source"></a>
|
|
75 |
### Getting the Source
|
|
76 |
|
|
77 |
To get the entire set of OpenJDK Mercurial repositories use the script
|
|
78 |
`get_source.sh` located in the root repository:
|
|
79 |
|
|
80 |
hg clone http://hg.openjdk.java.net/jdk9/jdk9 YourOpenJDK
|
|
81 |
cd YourOpenJDK
|
|
82 |
bash ./get_source.sh
|
|
83 |
|
|
84 |
Once you have all the repositories, keep in mind that each repository is its
|
|
85 |
own independent repository. You can also re-run `./get_source.sh` anytime to
|
|
86 |
pull over all the latest changesets in all the repositories. This set of
|
|
87 |
nested repositories has been given the term "forest" and there are various
|
|
88 |
ways to apply the same `hg` command to each of the repositories. For
|
|
89 |
example, the script `make/scripts/hgforest.sh` can be used to repeat the
|
|
90 |
same `hg` command on every repository, e.g.
|
|
91 |
|
|
92 |
cd YourOpenJDK
|
|
93 |
bash ./make/scripts/hgforest.sh status
|
|
94 |
|
|
95 |
<a name="repositories"></a>
|
|
96 |
### Repositories
|
|
97 |
|
|
98 |
The set of repositories and what they contain:
|
|
99 |
|
|
100 |
* **. (root)** contains common configure and makefile logic
|
|
101 |
* **hotspot** contains source code and make files for building the OpenJDK
|
|
102 |
Hotspot Virtual Machine
|
|
103 |
* **langtools** contains source code for the OpenJDK javac and language tools
|
|
104 |
* **jdk** contains source code and make files for building the OpenJDK runtime
|
|
105 |
libraries and misc files
|
|
106 |
* **jaxp** contains source code for the OpenJDK JAXP functionality
|
|
107 |
* **jaxws** contains source code for the OpenJDK JAX-WS functionality
|
|
108 |
* **corba** contains source code for the OpenJDK Corba functionality
|
|
109 |
* **nashorn** contains source code for the OpenJDK JavaScript implementation
|
|
110 |
|
|
111 |
### Repository Source Guidelines
|
|
112 |
|
|
113 |
There are some very basic guidelines:
|
|
114 |
|
|
115 |
* Use of whitespace in source files (.java, .c, .h, .cpp, and .hpp files) is
|
|
116 |
restricted. No TABs, no trailing whitespace on lines, and files should not
|
|
117 |
terminate in more than one blank line.
|
|
118 |
* Files with execute permissions should not be added to the source
|
|
119 |
repositories.
|
|
120 |
* All generated files need to be kept isolated from the files maintained or
|
|
121 |
managed by the source control system. The standard area for generated files
|
|
122 |
is the top level `build/` directory.
|
|
123 |
* The default build process should be to build the product and nothing else,
|
|
124 |
in one form, e.g. a product (optimized), debug (non-optimized, -g plus
|
|
125 |
assert logic), or fastdebug (optimized, -g plus assert logic).
|
|
126 |
* The `.hgignore` file in each repository must exist and should include
|
|
127 |
`^build/`, `^dist/` and optionally any `nbproject/private` directories. **It
|
|
128 |
should NEVER** include anything in the `src/` or `test/` or any managed
|
|
129 |
directory area of a repository.
|
|
130 |
* Directory names and file names should never contain blanks or non-printing
|
|
131 |
characters.
|
|
132 |
* Generated source or binary files should NEVER be added to the repository
|
|
133 |
(that includes `javah` output). There are some exceptions to this rule, in
|
|
134 |
particular with some of the generated configure scripts.
|
|
135 |
* Files not needed for typical building or testing of the repository should
|
|
136 |
not be added to the repository.
|
|
137 |
|
|
138 |
*****
|
|
139 |
|
|
140 |
<a name="building"></a>
|
|
141 |
## Building
|
|
142 |
|
|
143 |
The very first step in building the OpenJDK is making sure the system itself
|
|
144 |
has everything it needs to do OpenJDK builds. Once a system is setup, it
|
|
145 |
generally doesn't need to be done again.
|
|
146 |
|
|
147 |
Building the OpenJDK is now done with running a `configure` script which will
|
|
148 |
try and find and verify you have everything you need, followed by running
|
|
149 |
`make`, e.g.
|
|
150 |
|
|
151 |
> **`bash ./configure`**
|
|
152 |
> **`make all`**
|
|
153 |
|
|
154 |
Where possible the `configure` script will attempt to located the various
|
|
155 |
components in the default locations or via component specific variable
|
|
156 |
settings. When the normal defaults fail or components cannot be found,
|
|
157 |
additional `configure` options may be necessary to help `configure` find the
|
|
158 |
necessary tools for the build, or you may need to re-visit the setup of your
|
|
159 |
system due to missing software packages.
|
|
160 |
|
|
161 |
**NOTE:** The `configure` script file does not have execute permissions and
|
|
162 |
will need to be explicitly run with `bash`, see the source guidelines.
|
|
163 |
|
|
164 |
*****
|
|
165 |
|
|
166 |
<a name="setup"></a>
|
|
167 |
### System Setup
|
|
168 |
|
|
169 |
Before even attempting to use a system to build the OpenJDK there are some very
|
|
170 |
basic system setups needed. For all systems:
|
|
171 |
|
|
172 |
* Be sure the GNU make utility is version 3.81 (4.0 on windows) or newer, e.g.
|
|
173 |
run "`make -version`"
|
|
174 |
|
|
175 |
<a name="bootjdk"></a>
|
|
176 |
* Install a Bootstrap JDK. All OpenJDK builds require access to a previously
|
|
177 |
released JDK called the _bootstrap JDK_ or _boot JDK._ The general rule is
|
|
178 |
that the bootstrap JDK must be an instance of the previous major release of
|
|
179 |
the JDK. In addition, there may be a requirement to use a release at or
|
|
180 |
beyond a particular update level.
|
|
181 |
|
|
182 |
**_Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as
|
|
183 |
the boot JDK, to ensure that JDK 9 dependencies are not introduced into the
|
|
184 |
parts of the system that are built with JDK 8._**
|
|
185 |
|
|
186 |
The JDK 8 binaries can be downloaded from Oracle's [JDK 8 download
|
|
187 |
site](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
|
|
188 |
For build performance reasons it is very important that this bootstrap JDK
|
|
189 |
be made available on the local disk of the machine doing the build. You
|
|
190 |
should add its `bin` directory to the `PATH` environment variable. If
|
|
191 |
`configure` has any issues finding this JDK, you may need to use the
|
|
192 |
`configure` option `--with-boot-jdk`.
|
|
193 |
|
|
194 |
* Ensure that GNU make, the Bootstrap JDK, and the compilers are all in your
|
|
195 |
PATH environment variable.
|
|
196 |
|
|
197 |
And for specific systems:
|
|
198 |
|
|
199 |
* **Linux**
|
|
200 |
|
|
201 |
Install all the software development packages needed including
|
|
202 |
[alsa](#alsa), [freetype](#freetype), [cups](#cups), and
|
|
203 |
[xrender](#xrender). See [specific system packages](#SDBE).
|
|
204 |
|
|
205 |
* **Solaris**
|
|
206 |
|
|
207 |
Install all the software development packages needed including [Studio
|
|
208 |
Compilers](#studio), [freetype](#freetype), [cups](#cups), and
|
|
209 |
[xrender](#xrender). See [specific system packages](#SDBE).
|
|
210 |
|
|
211 |
* **Windows**
|
|
212 |
|
|
213 |
* Install one of [CYGWIN](#cygwin) or [MinGW/MSYS](#msys)
|
|
214 |
* Install [Visual Studio 2013](#vs2013)
|
|
215 |
|
|
216 |
* **Mac OS X**
|
|
217 |
|
|
218 |
Install [XCode 4.5.2](https://developer.apple.com/xcode/) and also
|
|
219 |
install the "Command line tools" found under the preferences pane
|
|
220 |
"Downloads"
|
|
221 |
|
|
222 |
<a name="linux"></a>
|
|
223 |
#### Linux
|
|
224 |
|
|
225 |
With Linux, try and favor the system packages over building your own or getting
|
|
226 |
packages from other areas. Most Linux builds should be possible with the
|
|
227 |
system's available packages.
|
|
228 |
|
|
229 |
Note that some Linux systems have a habit of pre-populating your environment
|
|
230 |
variables for you, for example `JAVA_HOME` might get pre-defined for you to
|
|
231 |
refer to the JDK installed on your Linux system. You will need to unset
|
|
232 |
`JAVA_HOME`. It's a good idea to run `env` and verify the environment variables
|
|
233 |
you are getting from the default system settings make sense for building the
|
|
234 |
OpenJDK.
|
|
235 |
|
|
236 |
<a name="solaris"></a>
|
|
237 |
#### Solaris
|
|
238 |
|
|
239 |
<a name="studio"></a>
|
|
240 |
##### Studio Compilers
|
|
241 |
|
|
242 |
At a minimum, the [Studio 12 Update 1 Compilers](http://www.oracle.com/
|
|
243 |
technetwork/server-storage/solarisstudio/downloads/index.htm) (containing
|
|
244 |
version 5.10 of the C and C++ compilers) is required, including specific
|
|
245 |
patches.
|
|
246 |
|
|
247 |
The Solaris SPARC patch list is:
|
|
248 |
|
|
249 |
* 118683-05: SunOS 5.10: Patch for profiling libraries and assembler
|
|
250 |
* 119963-21: SunOS 5.10: Shared library patch for C++
|
|
251 |
* 120753-08: SunOS 5.10: Microtasking libraries (libmtsk) patch
|
|
252 |
* 128228-09: Sun Studio 12 Update 1: Patch for Sun C++ Compiler
|
|
253 |
* 141860-03: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C
|
|
254 |
C++ F77 F95
|
|
255 |
* 141861-05: Sun Studio 12 Update 1: Patch for Sun C Compiler
|
|
256 |
* 142371-01: Sun Studio 12.1 Update 1: Patch for dbx
|
|
257 |
* 143384-02: Sun Studio 12 Update 1: Patch for debuginfo handling
|
|
258 |
* 143385-02: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C
|
|
259 |
C++ F77 F95
|
|
260 |
* 142369-01: Sun Studio 12.1: Patch for Performance Analyzer Tools
|
|
261 |
|
|
262 |
The Solaris X86 patch list is:
|
|
263 |
|
|
264 |
* 119961-07: SunOS 5.10_x86, x64, Patch for profiling libraries and assembler
|
|
265 |
* 119964-21: SunOS 5.10_x86: Shared library patch for C++\_x86
|
|
266 |
* 120754-08: SunOS 5.10_x86: Microtasking libraries (libmtsk) patch
|
|
267 |
* 141858-06: Sun Studio 12 Update 1_x86: Sun Compiler Common patch for x86
|
|
268 |
backend
|
|
269 |
* 128229-09: Sun Studio 12 Update 1_x86: Patch for C++ Compiler
|
|
270 |
* 142363-05: Sun Studio 12 Update 1_x86: Patch for C Compiler
|
|
271 |
* 142368-01: Sun Studio 12.1_x86: Patch for Performance Analyzer Tools
|
|
272 |
|
|
273 |
Place the `bin` directory in `PATH`.
|
|
274 |
|
|
275 |
The Oracle Solaris Studio Express compilers at: [Oracle Solaris Studio Express
|
|
276 |
Download site](http://www.oracle.com/technetwork/server-storage/solarisstudio/
|
|
277 |
downloads/index-jsp-142582.html) are also an option, although these compilers
|
|
278 |
have not been extensively used yet.
|
|
279 |
|
|
280 |
<a name="windows"></a>
|
|
281 |
#### Windows
|
|
282 |
|
|
283 |
##### Windows Unix Toolkit
|
|
284 |
|
|
285 |
Building on Windows requires a Unix-like environment, notably a Unix-like
|
|
286 |
shell. There are several such environments available of which
|
|
287 |
[Cygwin](http://www.cygwin.com/) and
|
|
288 |
[MinGW/MSYS](http://www.mingw.org/wiki/MSYS) are currently supported for the
|
|
289 |
OpenJDK build. One of the differences of these systems from standard Windows
|
|
290 |
tools is the way they handle Windows path names, particularly path names which
|
|
291 |
contain spaces, backslashes as path separators and possibly drive letters.
|
|
292 |
Depending on the use case and the specifics of each environment these path
|
|
293 |
problems can be solved by a combination of quoting whole paths, translating
|
|
294 |
backslashes to forward slashes, escaping backslashes with additional
|
|
295 |
backslashes and translating the path names to their ["8.3"
|
|
296 |
version](http://en.wikipedia.org/wiki/8.3_filename).
|
|
297 |
|
|
298 |
<a name="cygwin"></a>
|
|
299 |
###### CYGWIN
|
|
300 |
|
|
301 |
CYGWIN is an open source, Linux-like environment which tries to emulate a
|
|
302 |
complete POSIX layer on Windows. It tries to be smart about path names and can
|
|
303 |
usually handle all kinds of paths if they are correctly quoted or escaped
|
|
304 |
although internally it maps drive letters `<drive>:` to a virtual directory
|
|
305 |
`/cygdrive/<drive>`.
|
|
306 |
|
|
307 |
You can always use the `cygpath` utility to map pathnames with spaces or the
|
|
308 |
backslash character into the `C:/` style of pathname (called 'mixed'), e.g.
|
|
309 |
`cygpath -s -m "<path>"`.
|
|
310 |
|
|
311 |
Note that the use of CYGWIN creates a unique problem with regards to setting
|
|
312 |
[`PATH`](#path). Normally on Windows the `PATH` variable contains directories
|
|
313 |
separated with the ";" character (Solaris and Linux use ":"). With CYGWIN, it
|
|
314 |
uses ":", but that means that paths like "C:/path" cannot be placed in the
|
|
315 |
CYGWIN version of `PATH` and instead CYGWIN uses something like
|
|
316 |
`/cygdrive/c/path` which CYGWIN understands, but only CYGWIN understands.
|
|
317 |
|
|
318 |
The OpenJDK build requires CYGWIN version 1.7.16 or newer. Information about
|
|
319 |
CYGWIN can be obtained from the CYGWIN website at
|
|
320 |
[www.cygwin.com](http://www.cygwin.com).
|
|
321 |
|
|
322 |
By default CYGWIN doesn't install all the tools required for building the
|
|
323 |
OpenJDK. Along with the default installation, you need to install the following
|
|
324 |
tools.
|
|
325 |
|
|
326 |
> <table border="1">
|
|
327 |
<thead>
|
|
328 |
<tr>
|
|
329 |
<td>Binary Name</td>
|
|
330 |
<td>Category</td>
|
|
331 |
<td>Package</td>
|
|
332 |
<td>Description</td>
|
|
333 |
</tr>
|
|
334 |
</thead>
|
|
335 |
<tbody>
|
|
336 |
<tr>
|
|
337 |
<td>ar.exe</td>
|
|
338 |
<td>Devel</td>
|
|
339 |
<td>binutils</td>
|
|
340 |
<td>The GNU assembler, linker and binary utilities</td>
|
|
341 |
</tr>
|
|
342 |
<tr>
|
|
343 |
<td>make.exe</td>
|
|
344 |
<td>Devel</td>
|
|
345 |
<td>make</td>
|
|
346 |
<td>The GNU version of the 'make' utility built for CYGWIN</td>
|
|
347 |
</tr>
|
|
348 |
<tr>
|
|
349 |
<td>m4.exe</td>
|
|
350 |
<td>Interpreters</td>
|
|
351 |
<td>m4</td>
|
|
352 |
<td>GNU implementation of the traditional Unix macro processor</td>
|
|
353 |
</tr>
|
|
354 |
<tr>
|
|
355 |
<td>cpio.exe</td>
|
|
356 |
<td>Utils</td>
|
|
357 |
<td>cpio</td>
|
|
358 |
<td>A program to manage archives of files</td>
|
|
359 |
</tr>
|
|
360 |
<tr>
|
|
361 |
<td>gawk.exe</td>
|
|
362 |
<td>Utils</td>
|
|
363 |
<td>awk</td>
|
|
364 |
<td>Pattern-directed scanning and processing language</td>
|
|
365 |
</tr>
|
|
366 |
<tr>
|
|
367 |
<td>file.exe</td>
|
|
368 |
<td>Utils</td>
|
|
369 |
<td>file</td>
|
|
370 |
<td>Determines file type using 'magic' numbers</td>
|
|
371 |
</tr>
|
|
372 |
<tr>
|
|
373 |
<td>zip.exe</td>
|
|
374 |
<td>Archive</td>
|
|
375 |
<td>zip</td>
|
|
376 |
<td>Package and compress (archive) files</td>
|
|
377 |
</tr>
|
|
378 |
<tr>
|
|
379 |
<td>unzip.exe</td>
|
|
380 |
<td>Archive</td>
|
|
381 |
<td>unzip</td>
|
|
382 |
<td>Extract compressed files in a ZIP archive</td>
|
|
383 |
</tr>
|
|
384 |
<tr>
|
|
385 |
<td>free.exe</td>
|
|
386 |
<td>System</td>
|
|
387 |
<td>procps</td>
|
|
388 |
<td>Display amount of free and used memory in the system</td>
|
|
389 |
</tr>
|
|
390 |
</tbody>
|
|
391 |
</table>
|
|
392 |
|
|
393 |
Note that the CYGWIN software can conflict with other non-CYGWIN software on
|
|
394 |
your Windows system. CYGWIN provides a [FAQ](http://cygwin.com/faq/
|
|
395 |
faq.using.html) for known issues and problems, of particular interest is the
|
|
396 |
section on [BLODA (applications that interfere with
|
|
397 |
CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda).
|
|
398 |
|
|
399 |
<a name="msys"></a>
|
|
400 |
###### MinGW/MSYS
|
|
401 |
|
|
402 |
MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific
|
|
403 |
header files and import libraries combined with GNU toolsets that allow one to
|
|
404 |
produce native Windows programs that do not rely on any 3rd-party C runtime
|
|
405 |
DLLs. MSYS is a supplement to MinGW which allows building applications and
|
|
406 |
programs which rely on traditional UNIX tools to be present. Among others this
|
|
407 |
includes tools like `bash` and `make`. See [MinGW/MSYS](http://www.mingw.org/
|
|
408 |
wiki/MSYS) for more information.
|
|
409 |
|
|
410 |
Like Cygwin, MinGW/MSYS can handle different types of path formats. They are
|
|
411 |
internally converted to paths with forward slashes and drive letters
|
|
412 |
`<drive>:` replaced by a virtual directory `/<drive>`. Additionally, MSYS
|
|
413 |
automatically detects binaries compiled for the MSYS environment and feeds them
|
|
414 |
with the internal, Unix-style path names. If native Windows applications are
|
|
415 |
called from within MSYS programs their path arguments are automatically
|
|
416 |
converted back to Windows style path names with drive letters and backslashes
|
|
417 |
as path separators. This may cause problems for Windows applications which use
|
|
418 |
forward slashes as parameter separator (e.g. `cl /nologo /I`) because MSYS may
|
|
419 |
wrongly [replace such parameters by drive letters](http://mingw.org/wiki/
|
|
420 |
Posix_path_conversion).
|
|
421 |
|
|
422 |
In addition to the tools which will be installed by default, you have to
|
|
423 |
manually install the `msys-zip` and `msys-unzip` packages. This can be easily
|
|
424 |
done with the MinGW command line installer:
|
|
425 |
|
|
426 |
mingw-get.exe install msys-zip
|
|
427 |
mingw-get.exe install msys-unzip
|
|
428 |
|
|
429 |
<a name="vs2013"></a>
|
|
430 |
##### Visual Studio 2013 Compilers
|
|
431 |
|
|
432 |
The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio
|
|
433 |
C++ 2013 (VS2013) Professional Edition or Express compiler. The compiler and
|
|
434 |
other tools are expected to reside in the location defined by the variable
|
|
435 |
`VS120COMNTOOLS` which is set by the Microsoft Visual Studio installer.
|
|
436 |
|
|
437 |
Only the C++ part of VS2013 is needed. Try to let the installation go to the
|
|
438 |
default install directory. Always reboot your system after installing VS2013.
|
|
439 |
The system environment variable VS120COMNTOOLS should be set in your
|
|
440 |
environment.
|
|
441 |
|
|
442 |
Make sure that TMP and TEMP are also set in the environment and refer to
|
|
443 |
Windows paths that exist, like `C:\temp`, not `/tmp`, not `/cygdrive/c/temp`,
|
|
444 |
and not `C:/temp`. `C:\temp` is just an example, it is assumed that this area
|
|
445 |
is private to the user, so by default after installs you should see a unique
|
|
446 |
user path in these variables.
|
|
447 |
|
|
448 |
<a name="macosx"></a>
|
|
449 |
#### Mac OS X
|
|
450 |
|
|
451 |
Make sure you get the right XCode version.
|
|
452 |
|
|
453 |
*****
|
|
454 |
|
|
455 |
<a name="configure"></a>
|
|
456 |
### Configure
|
|
457 |
|
|
458 |
The basic invocation of the `configure` script looks like:
|
|
459 |
|
|
460 |
> **`bash ./configure [options]`**
|
|
461 |
|
|
462 |
This will create an output directory containing the "configuration" and setup
|
|
463 |
an area for the build result. This directory typically looks like:
|
|
464 |
|
|
465 |
> **`build/linux-x64-normal-server-release`**
|
|
466 |
|
|
467 |
`configure` will try to figure out what system you are running on and where all
|
|
468 |
necessary build components are. If you have all prerequisites for building
|
|
469 |
installed, it should find everything. If it fails to detect any component
|
|
470 |
automatically, it will exit and inform you about the problem. When this
|
|
471 |
happens, read more below in [the `configure` options](#configureoptions).
|
|
472 |
|
|
473 |
Some examples:
|
|
474 |
|
|
475 |
> **Windows 32bit build with freetype specified:**
|
|
476 |
> `bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-
|
|
477 |
bits=32`
|
|
478 |
|
|
479 |
> **Debug 64bit Build:**
|
|
480 |
> `bash ./configure --enable-debug --with-target-bits=64`
|
|
481 |
|
|
482 |
<a name="configureoptions"></a>
|
|
483 |
#### Configure Options
|
|
484 |
|
|
485 |
Complete details on all the OpenJDK `configure` options can be seen with:
|
|
486 |
|
|
487 |
> **`bash ./configure --help=short`**
|
|
488 |
|
|
489 |
Use `-help` to see all the `configure` options available. You can generate any
|
|
490 |
number of different configurations, e.g. debug, release, 32, 64, etc.
|
|
491 |
|
|
492 |
Some of the more commonly used `configure` options are:
|
|
493 |
|
|
494 |
> **`--enable-debug`**
|
|
495 |
> set the debug level to fastdebug (this is a shorthand for `--with-debug-
|
|
496 |
level=fastdebug`)
|
|
497 |
|
|
498 |
<a name="alsa"></a>
|
|
499 |
> **`--with-alsa=`**_path_
|
|
500 |
> select the location of the Advanced Linux Sound Architecture (ALSA)
|
|
501 |
|
|
502 |
> Version 0.9.1 or newer of the ALSA files are required for building the
|
|
503 |
OpenJDK on Linux. These Linux files are usually available from an "alsa" of
|
|
504 |
"libasound" development package, and it's highly recommended that you try
|
|
505 |
and use the package provided by the particular version of Linux that you are
|
|
506 |
using.
|
|
507 |
|
|
508 |
> **`--with-boot-jdk=`**_path_
|
|
509 |
> select the [Bootstrap JDK](#bootjdk)
|
|
510 |
|
|
511 |
> **`--with-boot-jdk-jvmargs=`**"_args_"
|
|
512 |
> provide the JVM options to be used to run the [Bootstrap JDK](#bootjdk)
|
|
513 |
|
|
514 |
> **`--with-cacerts=`**_path_
|
|
515 |
> select the path to the cacerts file.
|
|
516 |
|
|
517 |
> See [Certificate Authority on Wikipedia](http://en.wikipedia.org/wiki/
|
|
518 |
Certificate_Authority) for a better understanding of the Certificate
|
|
519 |
Authority (CA). A certificates file named "cacerts" represents a system-wide
|
|
520 |
keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts"
|
|
521 |
file contains root CA certificates from several public CAs (e.g., VeriSign,
|
|
522 |
Thawte, and Baltimore). The source contain a cacerts file without CA root
|
|
523 |
certificates. Formal JDK builders will need to secure permission from each
|
|
524 |
public CA and include the certificates into their own custom cacerts file.
|
|
525 |
Failure to provide a populated cacerts file will result in verification
|
|
526 |
errors of a certificate chain during runtime. By default an empty cacerts
|
|
527 |
file is provided and that should be fine for most JDK developers.
|
|
528 |
|
|
529 |
<a name="cups"></a>
|
|
530 |
> **`--with-cups=`**_path_
|
|
531 |
> select the CUPS install location
|
|
532 |
|
|
533 |
> The Common UNIX Printing System (CUPS) Headers are required for building the
|
|
534 |
OpenJDK on Solaris and Linux. The Solaris header files can be obtained by
|
|
535 |
installing the package **SFWcups** from the Solaris Software Companion
|
|
536 |
CD/DVD, these often will be installed into the directory `/opt/sfw/cups`.
|
|
537 |
|
|
538 |
> The CUPS header files can always be downloaded from
|
|
539 |
[www.cups.org](http://www.cups.org).
|
|
540 |
|
|
541 |
> **`--with-cups-include=`**_path_
|
|
542 |
> select the CUPS include directory location
|
|
543 |
|
|
544 |
> **`--with-debug-level=`**_level_
|
|
545 |
> select the debug information level of release, fastdebug, or slowdebug
|
|
546 |
|
|
547 |
> **`--with-dev-kit=`**_path_
|
|
548 |
> select location of the compiler install or developer install location
|
|
549 |
|
|
550 |
<a name="freetype"></a>
|
|
551 |
> **`--with-freetype=`**_path_
|
|
552 |
> select the freetype files to use.
|
|
553 |
|
|
554 |
> Expecting the freetype libraries under `lib/` and the headers under
|
|
555 |
`include/`.
|
|
556 |
|
|
557 |
> Version 2.3 or newer of FreeType is required. On Unix systems required files
|
|
558 |
can be available as part of your distribution (while you still may need to
|
|
559 |
upgrade them). Note that you need development version of package that
|
|
560 |
includes both the FreeType library and header files.
|
|
561 |
|
|
562 |
> You can always download latest FreeType version from the [FreeType
|
|
563 |
website](http://www.freetype.org). Building the freetype 2 libraries from
|
|
564 |
scratch is also possible, however on Windows refer to the [Windows FreeType
|
|
565 |
DLL build instructions](http://freetype.freedesktop.org/wiki/FreeType_DLL).
|
|
566 |
|
|
567 |
> Note that by default FreeType is built with byte code hinting support
|
|
568 |
disabled due to licensing restrictions. In this case, text appearance and
|
|
569 |
metrics are expected to differ from Sun's official JDK build. See the
|
|
570 |
[SourceForge FreeType2 Home Page](http://freetype.sourceforge.net/freetype2)
|
|
571 |
for more information.
|
|
572 |
|
|
573 |
> **`--with-import-hotspot=`**_path_
|
|
574 |
> select the location to find hotspot binaries from a previous build to avoid
|
|
575 |
building hotspot
|
|
576 |
|
|
577 |
> **`--with-target-bits=`**_arg_
|
|
578 |
> select 32 or 64 bit build
|
|
579 |
|
|
580 |
> **`--with-jvm-variants=`**_variants_
|
|
581 |
> select the JVM variants to build from, comma separated list that can
|
|
582 |
include: server, client, kernel, zero and zeroshark
|
|
583 |
|
|
584 |
> **`--with-memory-size=`**_size_
|
|
585 |
> select the RAM size that GNU make will think this system has
|
|
586 |
|
|
587 |
> **`--with-msvcr-dll=`**_path_
|
|
588 |
> select the `msvcr100.dll` file to include in the Windows builds (C/C++
|
|
589 |
runtime library for Visual Studio).
|
|
590 |
|
|
591 |
> This is usually picked up automatically from the redist directories of
|
|
592 |
Visual Studio 2013.
|
|
593 |
|
|
594 |
> **`--with-num-cores=`**_cores_
|
|
595 |
> select the number of cores to use (processor count or CPU count)
|
|
596 |
|
|
597 |
<a name="xrender"></a>
|
|
598 |
> **`--with-x=`**_path_
|
|
599 |
> select the location of the X11 and xrender files.
|
|
600 |
|
|
601 |
> The XRender Extension Headers are required for building the OpenJDK on
|
|
602 |
Solaris and Linux. The Linux header files are usually available from a
|
|
603 |
"Xrender" development package, it's recommended that you try and use the
|
|
604 |
package provided by the particular distribution of Linux that you are using.
|
|
605 |
The Solaris XRender header files is included with the other X11 header files
|
|
606 |
in the package **SFWxwinc** on new enough versions of Solaris and will be
|
|
607 |
installed in `/usr/X11/include/X11/extensions/Xrender.h` or
|
|
608 |
`/usr/openwin/share/include/X11/extensions/Xrender.h`
|
|
609 |
|
|
610 |
*****
|
|
611 |
|
|
612 |
<a name="make"></a>
|
|
613 |
### Make
|
|
614 |
|
|
615 |
The basic invocation of the `make` utility looks like:
|
|
616 |
|
|
617 |
> **`make all`**
|
|
618 |
|
|
619 |
This will start the build to the output directory containing the
|
|
620 |
"configuration" that was created by the `configure` script. Run `make help` for
|
|
621 |
more information on the available targets.
|
|
622 |
|
|
623 |
There are some of the make targets that are of general interest:
|
|
624 |
|
|
625 |
> _empty_
|
|
626 |
> build everything but no images
|
|
627 |
|
|
628 |
> **`all`**
|
|
629 |
> build everything including images
|
|
630 |
|
|
631 |
> **`all-conf`**
|
|
632 |
> build all configurations
|
|
633 |
|
|
634 |
> **`images`**
|
|
635 |
> create complete j2sdk and j2re images
|
|
636 |
|
|
637 |
> **`install`**
|
|
638 |
> install the generated images locally, typically in `/usr/local`
|
|
639 |
|
|
640 |
> **`clean`**
|
|
641 |
> remove all files generated by make, but not those generated by `configure`
|
|
642 |
|
|
643 |
> **`dist-clean`**
|
|
644 |
> remove all files generated by both and `configure` (basically killing the
|
|
645 |
configuration)
|
|
646 |
|
|
647 |
> **`help`**
|
|
648 |
> give some help on using `make`, including some interesting make targets
|
|
649 |
|
|
650 |
*****
|
|
651 |
|
|
652 |
<a name="testing"></a>
|
|
653 |
## Testing
|
|
654 |
|
|
655 |
When the build is completed, you should see the generated binaries and
|
|
656 |
associated files in the `j2sdk-image` directory in the output directory. In
|
|
657 |
particular, the `build/*/images/j2sdk-image/bin` directory should contain
|
|
658 |
executables for the OpenJDK tools and utilities for that configuration. The
|
|
659 |
testing tool `jtreg` will be needed and can be found at: [the jtreg
|
|
660 |
site](http://openjdk.java.net/jtreg/). The provided regression tests in the
|
|
661 |
repositories can be run with the command:
|
|
662 |
|
|
663 |
> **``cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all``**
|
|
664 |
|
|
665 |
*****
|
|
666 |
|
|
667 |
<a name="hints"></a>
|
|
668 |
## Appendix A: Hints and Tips
|
|
669 |
|
|
670 |
<a name="faq"></a>
|
|
671 |
### FAQ
|
|
672 |
|
|
673 |
**Q:** The `generated-configure.sh` file looks horrible! How are you going to
|
|
674 |
edit it?
|
|
675 |
**A:** The `generated-configure.sh` file is generated (think "compiled") by the
|
|
676 |
autoconf tools. The source code is in `configure.ac` and various .m4 files in
|
|
677 |
common/autoconf, which are much more readable.
|
|
678 |
|
|
679 |
**Q:** Why is the `generated-configure.sh` file checked in, if it is
|
|
680 |
generated?
|
|
681 |
**A:** If it was not generated, every user would need to have the autoconf
|
|
682 |
tools installed, and re-generate the `configure` file as the first step. Our
|
|
683 |
goal is to minimize the work needed to be done by the user to start building
|
|
684 |
OpenJDK, and to minimize the number of external dependencies required.
|
|
685 |
|
|
686 |
**Q:** Do you require a specific version of autoconf for regenerating
|
|
687 |
`generated-configure.sh`?
|
|
688 |
**A:** Yes, version 2.69 is required and should be easy enough to aquire on all
|
|
689 |
supported operating systems. The reason for this is to avoid large spurious
|
|
690 |
changes in `generated-configure.sh`.
|
|
691 |
|
|
692 |
**Q:** How do you regenerate `generated-configure.sh` after making changes to
|
|
693 |
the input files?
|
|
694 |
**A:** Regnerating `generated-configure.sh` should always be done using the
|
|
695 |
script `common/autoconf/autogen.sh` to ensure that the correct files get
|
|
696 |
updated. This script should also be run after mercurial tries to merge
|
|
697 |
`generated-configure.sh` as a merge of the generated file is not guaranteed to
|
|
698 |
be correct.
|
|
699 |
|
|
700 |
**Q:** What are the files in `common/makefiles/support/*` for? They look like
|
|
701 |
gibberish.
|
|
702 |
**A:** They are a somewhat ugly hack to compensate for command line length
|
|
703 |
limitations on certain platforms (Windows, Solaris). Due to a combination of
|
|
704 |
limitations in make and the shell, command lines containing too many files will
|
|
705 |
not work properly. These helper files are part of an elaborate hack that will
|
|
706 |
compress the command line in the makefile and then uncompress it safely. We're
|
|
707 |
not proud of it, but it does fix the problem. If you have any better
|
|
708 |
suggestions, we're all ears! :-)
|
|
709 |
|
|
710 |
**Q:** I want to see the output of the commands that make runs, like in the old
|
|
711 |
build. How do I do that?
|
|
712 |
**A:** You specify the `LOG` variable to make. There are several log levels:
|
|
713 |
|
|
714 |
* **`warn`** -- Default and very quiet.
|
|
715 |
* **`info`** -- Shows more progress information than warn.
|
|
716 |
* **`debug`** -- Echos all command lines and prints all macro calls for
|
|
717 |
compilation definitions.
|
|
718 |
* **`trace`** -- Echos all $(shell) command lines as well.
|
|
719 |
|
|
720 |
**Q:** When do I have to re-run `configure`?
|
|
721 |
**A:** Normally you will run `configure` only once for creating a
|
|
722 |
configuration. You need to re-run configuration only if you want to change any
|
|
723 |
configuration options, or if you pull down changes to the `configure` script.
|
|
724 |
|
|
725 |
**Q:** I have added a new source file. Do I need to modify the makefiles?
|
|
726 |
**A:** Normally, no. If you want to create e.g. a new native library, you will
|
|
727 |
need to modify the makefiles. But for normal file additions or removals, no
|
|
728 |
changes are needed. There are certan exceptions for some native libraries where
|
|
729 |
the source files are spread over many directories which also contain sources
|
|
730 |
for other libraries. In these cases it was simply easier to create include
|
|
731 |
lists rather than excludes.
|
|
732 |
|
|
733 |
**Q:** When I run `configure --help`, I see many strange options, like
|
|
734 |
`--dvidir`. What is this?
|
|
735 |
**A:** Configure provides a slew of options by default, to all projects that
|
|
736 |
use autoconf. Most of them are not used in OpenJDK, so you can safely ignore
|
|
737 |
them. To list only OpenJDK specific features, use `configure --help=short`
|
|
738 |
instead.
|
|
739 |
|
|
740 |
**Q:** `configure` provides OpenJDK-specific features such as `--with-
|
|
741 |
builddeps-server` that are not described in this document. What about those?
|
|
742 |
**A:** Try them out if you like! But be aware that most of these are
|
|
743 |
experimental features. Many of them don't do anything at all at the moment; the
|
|
744 |
option is just a placeholder. Others depend on pieces of code or infrastructure
|
|
745 |
that is currently not ready for prime time.
|
|
746 |
|
|
747 |
**Q:** How will you make sure you don't break anything?
|
|
748 |
**A:** We have a script that compares the result of the new build system with
|
|
749 |
the result of the old. For most part, we aim for (and achieve) byte-by-byte
|
|
750 |
identical output. There are however technical issues with e.g. native binaries,
|
|
751 |
which might differ in a byte-by-byte comparison, even when building twice with
|
|
752 |
the old build system. For these, we compare relevant aspects (e.g. the symbol
|
|
753 |
table and file size). Note that we still don't have 100% equivalence, but we're
|
|
754 |
close.
|
|
755 |
|
|
756 |
**Q:** I noticed this thing X in the build that looks very broken by design.
|
|
757 |
Why don't you fix it?
|
|
758 |
**A:** Our goal is to produce a build output that is as close as technically
|
|
759 |
possible to the old build output. If things were weird in the old build, they
|
|
760 |
will be weird in the new build. Often, things were weird before due to
|
|
761 |
obscurity, but in the new build system the weird stuff comes up to the surface.
|
|
762 |
The plan is to attack these things at a later stage, after the new build system
|
|
763 |
is established.
|
|
764 |
|
|
765 |
**Q:** The code in the new build system is not that well-structured. Will you
|
|
766 |
fix this?
|
|
767 |
**A:** Yes! The new build system has grown bit by bit as we converted the old
|
|
768 |
system. When all of the old build system is converted, we can take a step back
|
|
769 |
and clean up the structure of the new build system. Some of this we plan to do
|
|
770 |
before replacing the old build system and some will need to wait until after.
|
|
771 |
|
|
772 |
**Q:** Is anything able to use the results of the new build's default make
|
|
773 |
target?
|
|
774 |
**A:** Yes, this is the minimal (or roughly minimal) set of compiled output
|
|
775 |
needed for a developer to actually execute the newly built JDK. The idea is
|
|
776 |
that in an incremental development fashion, when doing a normal make, you
|
|
777 |
should only spend time recompiling what's changed (making it purely
|
|
778 |
incremental) and only do the work that's needed to actually run and test your
|
|
779 |
code. The packaging stuff that is part of the `images` target is not needed for
|
|
780 |
a normal developer who wants to test his new code. Even if it's quite fast,
|
|
781 |
it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-)
|
|
782 |
(Or, well, at least single-digit seconds...)
|
|
783 |
|
|
784 |
**Q:** I usually set a specific environment variable when building, but I can't
|
|
785 |
find the equivalent in the new build. What should I do?
|
|
786 |
**A:** It might very well be that we have neglected to add support for an
|
|
787 |
option that was actually used from outside the build system. Email us and we
|
|
788 |
will add support for it!
|
|
789 |
|
|
790 |
<a name="performance"></a>
|
|
791 |
### Build Performance Tips
|
|
792 |
|
|
793 |
Building OpenJDK requires a lot of horsepower. Some of the build tools can be
|
|
794 |
adjusted to utilize more or less of resources such as parallel threads and
|
|
795 |
memory. The `configure` script analyzes your system and selects reasonable
|
|
796 |
values for such options based on your hardware. If you encounter resource
|
|
797 |
problems, such as out of memory conditions, you can modify the detected values
|
|
798 |
with:
|
|
799 |
|
|
800 |
* **`--with-num-cores`** -- number of cores in the build system, e.g.
|
|
801 |
`--with-num-cores=8`
|
|
802 |
* **`--with-memory-size`** -- memory (in MB) available in the build system,
|
|
803 |
e.g. `--with-memory-size=1024`
|
|
804 |
|
|
805 |
It might also be necessary to specify the JVM arguments passed to the Bootstrap
|
|
806 |
JDK, using e.g. `--with-boot-jdk-jvmargs="-Xmx8G -enableassertions"`. Doing
|
|
807 |
this will override the default JVM arguments passed to the Bootstrap JDK.
|
|
808 |
|
|
809 |
One of the top goals of the new build system is to improve the build
|
|
810 |
performance and decrease the time needed to build. This will soon also apply to
|
|
811 |
the java compilation when the Smart Javac wrapper is fully supported.
|
|
812 |
|
|
813 |
At the end of a successful execution of `configure`, you will get a performance
|
|
814 |
summary, indicating how well the build will perform. Here you will also get
|
|
815 |
performance hints. If you want to build fast, pay attention to those!
|
|
816 |
|
|
817 |
#### Building with ccache
|
|
818 |
|
|
819 |
The OpenJDK build supports building with ccache when using gcc or clang. Using
|
|
820 |
ccache can radically speed up compilation of native code if you often rebuild
|
|
821 |
the same sources. Your milage may vary however so we recommend evaluating it
|
|
822 |
for yourself. To enable it, make sure it's on the path and configure with
|
|
823 |
`--enable-ccache`.
|
|
824 |
|
|
825 |
#### Building on local disk
|
|
826 |
|
|
827 |
If you are using network shares, e.g. via NFS, for your source code, make sure
|
|
828 |
the build directory is situated on local disk. The performance penalty is
|
|
829 |
extremely high for building on a network share, close to unusable.
|
|
830 |
|
|
831 |
#### Building only one JVM
|
|
832 |
|
|
833 |
The old build builds multiple JVMs on 32-bit systems (client and server; and on
|
|
834 |
Windows kernel as well). In the new build we have changed this default to only
|
|
835 |
build server when it's available. This improves build times for those not
|
|
836 |
interested in multiple JVMs. To mimic the old behavior on platforms that
|
|
837 |
support it, use `--with-jvm-variants=client,server`.
|
|
838 |
|
|
839 |
#### Selecting the number of cores to build on
|
|
840 |
|
|
841 |
By default, `configure` will analyze your machine and run the make process in
|
|
842 |
parallel with as many threads as you have cores. This behavior can be
|
|
843 |
overridden, either "permanently" (on a `configure` basis) using
|
|
844 |
`--with-num-cores=N` or for a single build only (on a make basis), using
|
|
845 |
`make JOBS=N`.
|
|
846 |
|
|
847 |
If you want to make a slower build just this time, to save some CPU power for
|
|
848 |
other processes, you can run e.g. `make JOBS=2`. This will force the makefiles
|
|
849 |
to only run 2 parallel processes, or even `make JOBS=1` which will disable
|
|
850 |
parallelism.
|
|
851 |
|
|
852 |
If you want to have it the other way round, namely having slow builds default
|
|
853 |
and override with fast if you're impatient, you should call `configure` with
|
|
854 |
`--with-num-cores=2`, making 2 the default. If you want to run with more cores,
|
|
855 |
run `make JOBS=8`
|
|
856 |
|
|
857 |
<a name="troubleshooting"></a>
|
|
858 |
### Troubleshooting
|
|
859 |
|
|
860 |
#### Solving build problems
|
|
861 |
|
|
862 |
If the build fails (and it's not due to a compilation error in a source file
|
|
863 |
you've changed), the first thing you should do is to re-run the build with more
|
|
864 |
verbosity. Do this by adding `LOG=debug` to your make command line.
|
|
865 |
|
|
866 |
The build log (with both stdout and stderr intermingled, basically the same as
|
|
867 |
you see on your console) can be found as `build.log` in your build directory.
|
|
868 |
|
|
869 |
You can ask for help on build problems with the new build system on either the
|
|
870 |
[build-dev](http://mail.openjdk.java.net/mailman/listinfo/build-dev) or the
|
|
871 |
[build-infra-dev](http://mail.openjdk.java.net/mailman/listinfo/build-infra-dev)
|
|
872 |
mailing lists. Please include the relevant parts of the build log.
|
|
873 |
|
|
874 |
A build can fail for any number of reasons. Most failures are a result of
|
|
875 |
trying to build in an environment in which all the pre-build requirements have
|
|
876 |
not been met. The first step in troubleshooting a build failure is to recheck
|
|
877 |
that you have satisfied all the pre-build requirements for your platform.
|
|
878 |
Scanning the `configure` log is a good first step, making sure that what it
|
|
879 |
found makes sense for your system. Look for strange error messages or any
|
|
880 |
difficulties that `configure` had in finding things.
|
|
881 |
|
|
882 |
Some of the more common problems with builds are briefly described below, with
|
|
883 |
suggestions for remedies.
|
|
884 |
|
|
885 |
* **Corrupted Bundles on Windows:**
|
|
886 |
Some virus scanning software has been known to corrupt the downloading of
|
|
887 |
zip bundles. It may be necessary to disable the 'on access' or 'real time'
|
|
888 |
virus scanning features to prevent this corruption. This type of 'real time'
|
|
889 |
virus scanning can also slow down the build process significantly.
|
|
890 |
Temporarily disabling the feature, or excluding the build output directory
|
|
891 |
may be necessary to get correct and faster builds.
|
|
892 |
|
|
893 |
* **Slow Builds:**
|
|
894 |
If your build machine seems to be overloaded from too many simultaneous C++
|
|
895 |
compiles, try setting the `JOBS=1` on the `make` command line. Then try
|
|
896 |
increasing the count slowly to an acceptable level for your system. Also:
|
|
897 |
|
|
898 |
Creating the javadocs can be very slow, if you are running javadoc, consider
|
|
899 |
skipping that step.
|
|
900 |
|
|
901 |
Faster CPUs, more RAM, and a faster DISK usually helps. The VM build tends
|
|
902 |
to be CPU intensive (many C++ compiles), and the rest of the JDK will often
|
|
903 |
be disk intensive.
|
|
904 |
|
|
905 |
Faster compiles are possible using a tool called
|
|
906 |
[ccache](http://ccache.samba.org/).
|
|
907 |
|
|
908 |
* **File time issues:**
|
|
909 |
If you see warnings that refer to file time stamps, e.g.
|
|
910 |
|
|
911 |
> _Warning message:_ ` File 'xxx' has modification time in the future.`
|
|
912 |
> _Warning message:_ ` Clock skew detected. Your build may be incomplete.`
|
|
913 |
|
|
914 |
These warnings can occur when the clock on the build machine is out of sync
|
|
915 |
with the timestamps on the source files. Other errors, apparently unrelated
|
|
916 |
but in fact caused by the clock skew, can occur along with the clock skew
|
|
917 |
warnings. These secondary errors may tend to obscure the fact that the true
|
|
918 |
root cause of the problem is an out-of-sync clock.
|
|
919 |
|
|
920 |
If you see these warnings, reset the clock on the build machine, run
|
|
921 |
"`gmake clobber`" or delete the directory containing the build output, and
|
|
922 |
restart the build from the beginning.
|
|
923 |
|
|
924 |
* **Error message: `Trouble writing out table to disk`**
|
|
925 |
Increase the amount of swap space on your build machine. This could be
|
|
926 |
caused by overloading the system and it may be necessary to use:
|
|
927 |
|
|
928 |
> `make JOBS=1`
|
|
929 |
|
|
930 |
to reduce the load on the system.
|
|
931 |
|
|
932 |
* **Error Message: `libstdc++ not found`:**
|
|
933 |
This is caused by a missing libstdc++.a library. This is installed as part
|
|
934 |
of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit
|
|
935 |
Linux versions (e.g. Fedora) only install the 64-bit version of the
|
|
936 |
libstdc++ package. Various parts of the JDK build require a static link of
|
|
937 |
the C++ runtime libraries to allow for maximum portability of the built
|
|
938 |
images.
|
|
939 |
|
|
940 |
* **Linux Error Message: `cannot restore segment prot after reloc`**
|
|
941 |
This is probably an issue with SELinux (See [SELinux on
|
|
942 |
Wikipedia](http://en.wikipedia.org/wiki/SELinux)). Parts of the VM is built
|
|
943 |
without the `-fPIC` for performance reasons.
|
|
944 |
|
|
945 |
To completely disable SELinux:
|
|
946 |
|
|
947 |
1. `$ su root`
|
|
948 |
2. `# system-config-securitylevel`
|
|
949 |
3. `In the window that appears, select the SELinux tab`
|
|
950 |
4. `Disable SELinux`
|
|
951 |
|
|
952 |
Alternatively, instead of completely disabling it you could disable just
|
|
953 |
this one check.
|
|
954 |
|
|
955 |
1. Select System->Administration->SELinux Management
|
|
956 |
2. In the SELinux Management Tool which appears, select "Boolean" from the
|
|
957 |
menu on the left
|
|
958 |
3. Expand the "Memory Protection" group
|
|
959 |
4. Check the first item, labeled "Allow all unconfined executables to use
|
|
960 |
libraries requiring text relocation ..."
|
|
961 |
|
|
962 |
* **Windows Error Messages:**
|
|
963 |
`*** fatal error - couldn't allocate heap, ... `
|
|
964 |
`rm fails with "Directory not empty"`
|
|
965 |
`unzip fails with "cannot create ... Permission denied"`
|
|
966 |
`unzip fails with "cannot create ... Error 50"`
|
|
967 |
|
|
968 |
The CYGWIN software can conflict with other non-CYGWIN software. See the
|
|
969 |
CYGWIN FAQ section on [BLODA (applications that interfere with
|
|
970 |
CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda).
|
|
971 |
|
|
972 |
* **Windows Error Message: `spawn failed`**
|
|
973 |
Try rebooting the system, or there could be some kind of issue with the disk
|
|
974 |
or disk partition being used. Sometimes it comes with a "Permission Denied"
|
|
975 |
message.
|
|
976 |
|
|
977 |
*****
|
|
978 |
|
|
979 |
<a name="gmake"></a>
|
|
980 |
## Appendix B: GNU make
|
|
981 |
|
|
982 |
The Makefiles in the OpenJDK are only valid when used with the GNU version of
|
|
983 |
the utility command `make` (usually called `gmake` on Solaris). A few notes
|
|
984 |
about using GNU make:
|
|
985 |
|
|
986 |
* You need GNU make version 3.81 or newer. On Windows 4.0 or newer is
|
|
987 |
recommended. If the GNU make utility on your systems is not of a suitable
|
|
988 |
version, see "[Building GNU make](#buildgmake)".
|
|
989 |
* Place the location of the GNU make binary in the `PATH`.
|
|
990 |
* **Solaris:** Do NOT use `/usr/bin/make` on Solaris. If your Solaris system
|
|
991 |
has the software from the Solaris Developer Companion CD installed, you
|
|
992 |
should try and use `gmake` which will be located in either the `/usr/bin`,
|
|
993 |
`/opt/sfw/bin` or `/usr/sfw/bin` directory.
|
|
994 |
* **Windows:** Make sure you start your build inside a bash shell.
|
|
995 |
* **Mac OS X:** The XCode "command line tools" must be installed on your Mac.
|
|
996 |
|
|
997 |
Information on GNU make, and access to ftp download sites, are available on the
|
|
998 |
[GNU make web site ](http://www.gnu.org/software/make/make.html). The latest
|
|
999 |
source to GNU make is available at
|
|
1000 |
[ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/).
|
|
1001 |
|
|
1002 |
<a name="buildgmake"></a>
|
|
1003 |
### Building GNU make
|
|
1004 |
|
|
1005 |
First step is to get the GNU make 3.81 or newer source from
|
|
1006 |
[ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/). Building is a
|
|
1007 |
little different depending on the OS but is basically done with:
|
|
1008 |
|
|
1009 |
bash ./configure
|
|
1010 |
make
|
|
1011 |
|
|
1012 |
*****
|
|
1013 |
|
|
1014 |
<a name="buildenvironments"></a>
|
|
1015 |
## Appendix C: Build Environments
|
|
1016 |
|
|
1017 |
### Minimum Build Environments
|
|
1018 |
|
|
1019 |
This file often describes specific requirements for what we call the "minimum
|
|
1020 |
build environments" (MBE) for this specific release of the JDK. What is listed
|
|
1021 |
below is what the Oracle Release Engineering Team will use to build the Oracle
|
|
1022 |
JDK product. Building with the MBE will hopefully generate the most compatible
|
|
1023 |
bits that install on, and run correctly on, the most variations of the same
|
|
1024 |
base OS and hardware architecture. In some cases, these represent what is often
|
|
1025 |
called the least common denominator, but each Operating System has different
|
|
1026 |
aspects to it.
|
|
1027 |
|
|
1028 |
In all cases, the Bootstrap JDK version minimum is critical, we cannot
|
|
1029 |
guarantee builds will work with older Bootstrap JDK's. Also in all cases, more
|
|
1030 |
RAM and more processors is better, the minimums listed below are simply
|
|
1031 |
recommendations.
|
|
1032 |
|
|
1033 |
With Solaris and Mac OS X, the version listed below is the oldest release we
|
|
1034 |
can guarantee builds and works, and the specific version of the compilers used
|
|
1035 |
could be critical.
|
|
1036 |
|
|
1037 |
With Windows the critical aspect is the Visual Studio compiler used, which due
|
|
1038 |
to it's runtime, generally dictates what Windows systems can do the builds and
|
|
1039 |
where the resulting bits can be used.
|
|
1040 |
|
|
1041 |
**NOTE: We expect a change here off these older Windows OS releases and to a
|
|
1042 |
'less older' one, probably Windows 2008R2 X64.**
|
|
1043 |
|
|
1044 |
With Linux, it was just a matter of picking a stable distribution that is a
|
|
1045 |
good representative for Linux in general.
|
|
1046 |
|
|
1047 |
**NOTE: We expect a change here from Fedora 9 to something else, but it has not
|
|
1048 |
been completely determined yet, possibly Ubuntu 12.04 X64, unbiased community
|
|
1049 |
feedback would be welcome on what a good choice would be here.**
|
|
1050 |
|
|
1051 |
It is understood that most developers will NOT be using these specific
|
|
1052 |
versions, and in fact creating these specific versions may be difficult due to
|
|
1053 |
the age of some of this software. It is expected that developers are more often
|
|
1054 |
using the more recent releases and distributions of these operating systems.
|
|
1055 |
|
|
1056 |
Compilation problems with newer or different C/C++ compilers is a common
|
|
1057 |
problem. Similarly, compilation problems related to changes to the
|
|
1058 |
`/usr/include` or system header files is also a common problem with older,
|
|
1059 |
newer, or unreleased OS versions. Please report these types of problems as bugs
|
|
1060 |
so that they can be dealt with accordingly.
|
|
1061 |
|
|
1062 |
> <table border="1">
|
|
1063 |
<thead>
|
|
1064 |
<tr>
|
|
1065 |
<th>Base OS and Architecture</th>
|
|
1066 |
<th>OS</th>
|
|
1067 |
<th>C/C++ Compiler</th>
|
|
1068 |
<th>Bootstrap JDK</th>
|
|
1069 |
<th>Processors</th>
|
|
1070 |
<th>RAM Minimum</th>
|
|
1071 |
<th>DISK Needs</th>
|
|
1072 |
</tr>
|
|
1073 |
</thead>
|
|
1074 |
<tbody>
|
|
1075 |
<tr>
|
|
1076 |
<td>Linux X86 (32-bit) and X64 (64-bit)</td>
|
|
1077 |
<td>Oracle Enterprise Linux 6.4</td>
|
|
1078 |
<td>gcc 4.8.2 </td>
|
|
1079 |
<td>JDK 8</td>
|
|
1080 |
<td>2 or more</td>
|
|
1081 |
<td>1 GB</td>
|
|
1082 |
<td>6 GB</td>
|
|
1083 |
</tr>
|
|
1084 |
<tr>
|
|
1085 |
<td>Solaris SPARCV9 (64-bit)</td>
|
|
1086 |
<td>Solaris 10 Update 10</td>
|
|
1087 |
<td>Studio 12 Update 3 + patches</td>
|
|
1088 |
<td>JDK 8</td>
|
|
1089 |
<td>4 or more</td>
|
|
1090 |
<td>4 GB</td>
|
|
1091 |
<td>8 GB</td>
|
|
1092 |
</tr>
|
|
1093 |
<tr>
|
|
1094 |
<td>Solaris X64 (64-bit)</td>
|
|
1095 |
<td>Solaris 10 Update 10</td>
|
|
1096 |
<td>Studio 12 Update 3 + patches</td>
|
|
1097 |
<td>JDK 8</td>
|
|
1098 |
<td>4 or more</td>
|
|
1099 |
<td>4 GB</td>
|
|
1100 |
<td>8 GB</td>
|
|
1101 |
</tr>
|
|
1102 |
<tr>
|
|
1103 |
<td>Windows X86 (32-bit)</td>
|
|
1104 |
<td>Windows Server 2012 R2 x64</td>
|
|
1105 |
<td>Microsoft Visual Studio C++ 2013 Professional Edition</td>
|
|
1106 |
<td>JDK 8</td>
|
|
1107 |
<td>2 or more</td>
|
|
1108 |
<td>2 GB</td>
|
|
1109 |
<td>6 GB</td>
|
|
1110 |
</tr>
|
|
1111 |
<tr>
|
|
1112 |
<td>Windows X64 (64-bit)</td>
|
|
1113 |
<td>Windows Server 2012 R2 x64</td>
|
|
1114 |
<td>Microsoft Visual Studio C++ 2013 Professional Edition</td>
|
|
1115 |
<td>JDK 8</td>
|
|
1116 |
<td>2 or more</td>
|
|
1117 |
<td>2 GB</td>
|
|
1118 |
<td>6 GB</td>
|
|
1119 |
</tr>
|
|
1120 |
<tr>
|
|
1121 |
<td>Mac OS X X64 (64-bit)</td>
|
|
1122 |
<td>Mac OS X 10.9 "Mavericks"</td>
|
|
1123 |
<td>XCode 5.1.1 or newer</td>
|
|
1124 |
<td>JDK 8</td>
|
|
1125 |
<td>2 or more</td>
|
|
1126 |
<td>4 GB</td>
|
|
1127 |
<td>6 GB</td>
|
|
1128 |
</tr>
|
|
1129 |
</tbody>
|
|
1130 |
</table>
|
|
1131 |
|
|
1132 |
*****
|
|
1133 |
|
|
1134 |
<a name="SDBE"></a>
|
|
1135 |
### Specific Developer Build Environments
|
|
1136 |
|
|
1137 |
We won't be listing all the possible environments, but we will try to provide
|
|
1138 |
what information we have available to us.
|
|
1139 |
|
|
1140 |
**NOTE: The community can help out by updating this part of the document.**
|
|
1141 |
|
|
1142 |
#### Fedora
|
|
1143 |
|
|
1144 |
After installing the latest [Fedora](http://fedoraproject.org) you need to
|
|
1145 |
install several build dependencies. The simplest way to do it is to execute the
|
|
1146 |
following commands as user `root`:
|
|
1147 |
|
|
1148 |
yum-builddep java-1.7.0-openjdk
|
|
1149 |
yum install gcc gcc-c++
|
|
1150 |
|
|
1151 |
In addition, it's necessary to set a few environment variables for the build:
|
|
1152 |
|
|
1153 |
export LANG=C
|
|
1154 |
export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
|
|
1155 |
|
|
1156 |
#### CentOS 5.5
|
|
1157 |
|
|
1158 |
After installing [CentOS 5.5](http://www.centos.org/) you need to make sure you
|
|
1159 |
have the following Development bundles installed:
|
|
1160 |
|
|
1161 |
* Development Libraries
|
|
1162 |
* Development Tools
|
|
1163 |
* Java Development
|
|
1164 |
* X Software Development (Including XFree86-devel)
|
|
1165 |
|
|
1166 |
Plus the following packages:
|
|
1167 |
|
|
1168 |
* cups devel: Cups Development Package
|
|
1169 |
* alsa devel: Alsa Development Package
|
|
1170 |
* Xi devel: libXi.so Development Package
|
|
1171 |
|
|
1172 |
The freetype 2.3 packages don't seem to be available, but the freetype 2.3
|
|
1173 |
sources can be downloaded, built, and installed easily enough from [the
|
|
1174 |
freetype site](http://downloads.sourceforge.net/freetype). Build and install
|
|
1175 |
with something like:
|
|
1176 |
|
|
1177 |
bash ./configure
|
|
1178 |
make
|
|
1179 |
sudo -u root make install
|
|
1180 |
|
|
1181 |
Mercurial packages could not be found easily, but a Google search should find
|
|
1182 |
ones, and they usually include Python if it's needed.
|
|
1183 |
|
|
1184 |
#### Debian 5.0 (Lenny)
|
|
1185 |
|
|
1186 |
After installing [Debian](http://debian.org) 5 you need to install several
|
|
1187 |
build dependencies. The simplest way to install the build dependencies is to
|
|
1188 |
execute the following commands as user `root`:
|
|
1189 |
|
|
1190 |
aptitude build-dep openjdk-7
|
|
1191 |
aptitude install openjdk-7-jdk libmotif-dev
|
|
1192 |
|
|
1193 |
In addition, it's necessary to set a few environment variables for the build:
|
|
1194 |
|
|
1195 |
export LANG=C
|
|
1196 |
export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
|
|
1197 |
|
|
1198 |
#### Ubuntu 12.04
|
|
1199 |
|
|
1200 |
After installing [Ubuntu](http://ubuntu.org) 12.04 you need to install several
|
|
1201 |
build dependencies. The simplest way to do it is to execute the following
|
|
1202 |
commands:
|
|
1203 |
|
|
1204 |
sudo aptitude build-dep openjdk-7
|
|
1205 |
sudo aptitude install openjdk-7-jdk
|
|
1206 |
|
|
1207 |
In addition, it's necessary to set a few environment variables for the build:
|
|
1208 |
|
|
1209 |
export LANG=C
|
|
1210 |
export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
|
|
1211 |
|
|
1212 |
#### OpenSUSE 11.1
|
|
1213 |
|
|
1214 |
After installing [OpenSUSE](http://opensuse.org) 11.1 you need to install
|
|
1215 |
several build dependencies. The simplest way to install the build dependencies
|
|
1216 |
is to execute the following commands:
|
|
1217 |
|
|
1218 |
sudo zypper source-install -d java-1_7_0-openjdk
|
|
1219 |
sudo zypper install make
|
|
1220 |
|
|
1221 |
In addition, it is necessary to set a few environment variables for the build:
|
|
1222 |
|
|
1223 |
export LANG=C
|
|
1224 |
export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
|
|
1225 |
|
|
1226 |
Finally, you need to unset the `JAVA_HOME` environment variable:
|
|
1227 |
|
|
1228 |
export -n JAVA_HOME`
|
|
1229 |
|
|
1230 |
#### Mandriva Linux One 2009 Spring
|
|
1231 |
|
|
1232 |
After installing [Mandriva](http://mandriva.org) Linux One 2009 Spring you need
|
|
1233 |
to install several build dependencies. The simplest way to install the build
|
|
1234 |
dependencies is to execute the following commands as user `root`:
|
|
1235 |
|
|
1236 |
urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ freetype-devel zip unzip
|
|
1237 |
libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel
|
|
1238 |
libxtst6-devel libxi-devel
|
|
1239 |
|
|
1240 |
In addition, it is necessary to set a few environment variables for the build:
|
|
1241 |
|
|
1242 |
export LANG=C
|
|
1243 |
export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
|
|
1244 |
|
|
1245 |
#### OpenSolaris 2009.06
|
|
1246 |
|
|
1247 |
After installing [OpenSolaris](http://opensolaris.org) 2009.06 you need to
|
|
1248 |
install several build dependencies. The simplest way to install the build
|
|
1249 |
dependencies is to execute the following commands:
|
|
1250 |
|
|
1251 |
pfexec pkg install SUNWgmake SUNWj7dev sunstudioexpress SUNWcups SUNWzip
|
|
1252 |
SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2
|
|
1253 |
|
|
1254 |
In addition, it is necessary to set a few environment variables for the build:
|
|
1255 |
|
|
1256 |
export LANG=C
|
|
1257 |
export PATH="/opt/SunStudioExpress/bin:${PATH}"
|
|
1258 |
|
|
1259 |
*****
|
|
1260 |
|
|
1261 |
End of the OpenJDK build README document.
|
|
1262 |
|
|
1263 |
Please come again!
|