Fri, 23 Dec 2011 16:36:17 -0800
Merge
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <title>OpenJDK Build README</title>
5 </head>
6 <body style="background-color:lightcyan">
7 <!-- ====================================================== -->
8 <table width="100%">
9 <tr>
10 <td align="center">
11 <img alt="OpenJDK"
12 src="http://openjdk.java.net/images/openjdk.png"
13 width=256 />
14 </td>
15 </tr>
16 <tr>
17 <td align=center>
18 <h1>OpenJDK Build README</h1>
19 </td>
20 </tr>
21 </table>
22 <!-- ------------------------------------------------------ -->
23 <hr>
24 <h2><a name="introduction">Introduction</a></h2>
25 <blockquote>
26 <p>
27 This README file contains build instructions for the
28 <a href="http://openjdk.java.net" target="_blank">OpenJDK</a>.
29 Building the source code for the
30 OpenJDK
31 requires
32 a certain degree of technical expertise.
33 </blockquote>
34 <!-- ------------------------------------------------------ -->
35 <hr>
36 <h2><a name="contents">Contents</a></h2>
37 <blockquote>
38 <ul>
39 <li><a href="#introduction">Introduction</a></li>
40 <li><a href="#hg">Use of Mercurial</a>
41 <ul>
42 <li><a href="#get_source">Getting the Source</a></li>
43 </ul>
44 </li>
45 <li><a href="#MBE">Minimum Build Environments</a></li>
46 <li><a href="#SDBE">Specific Developer Build Environments</a>
47 <ul>
48 <li><a href="#fedora">Fedora Linux</a> </li>
49 <li><a href="#centos">CentOS Linux</a> </li>
50 <li><a href="#debian">Debian GNU/Linux</a></li>
51 <li><a href="#ubuntu">Ubuntu Linux</a> </li>
52 <li><a href="#opensuse">OpenSUSE</a></li>
53 <li><a href="#mandriva">Mandriva</a></li>
54 <li><a href="#opensolaris">OpenSolaris</a></li>
55 </ul>
56 </li>
57 <li><a href="#directories">Source Directory Structure</a>
58 <ul>
59 <li><a href="#drops">Managing the Source Drops</a></li>
60 </ul>
61 </li>
62 <li><a href="#building">Build Information</a>
63 <ul>
64 <li><a href="#gmake">GNU Make (<tt><i>gmake</i></tt>)</a> </li>
65 <li><a href="#linux">Basic Linux System Setup</a> </li>
66 <li><a href="#solaris">Basic Solaris System Setup</a> </li>
67 <li><a href="#windows">Basic Windows System Setup</a> </li>
68 <li><a href="#dependencies">Build Dependencies</a>
69 <ul>
70 <li><a href="#bootjdk">Bootstrap JDK</a> </li>
71 <li><a href="#importjdk">Optional Import JDK</a> </li>
72 <li><a href="#ant">Ant 1.7.1</a> </li>
73 <li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
74 <li><a href="#compilers">Compilers</a>
75 <ul>
76 <li><a href="#msvc32">Microsoft Visual Studio Professional/Express for 32 bit</a> </li>
77 <li><a href="#msvc64">Microsoft Visual Studio Professional for 64 bit</a> </li>
78 <li><a href="#mssdk64">Microsoft Windows SDK for 64 bit</a> </li>
79 <li><a href="#gcc">Linux gcc/binutils</a> </li>
80 <li><a href="#studio">Sun Studio</a> </li>
81 </ul>
82 </li>
83 <li><a href="#zip">Zip and Unzip</a> </li>
84 <li><a href="#freetype">FreeType2 Fonts</a> </li>
85 <li>Linux and Solaris:
86 <ul>
87 <li><a href="#cups">CUPS Include files</a> </li>
88 <li><a href="#xrender">XRender Include files</a></li>
89 </ul>
90 </li>
91 <li>Linux only:
92 <ul>
93 <li><a href="#alsa">ALSA files</a> </li>
94 </ul>
95 </li>
96 <li>Windows only:
97 <ul>
98 <li>Unix Command Tools (<a href="#cygwin">CYGWIN</a>)</li>
99 <li><a href="#dxsdk">DirectX 9.0 SDK</a> </li>
100 </ul>
101 </li>
102 </ul>
103 </li>
104 </ul>
105 </li>
106 <li><a href="#creating">Creating the Build</a> </li>
107 <li><a href="#testing">Testing the Build</a> </li>
108 <li><a href="#variables">Environment/Make Variables</a></li>
109 <li><a href="#troubleshooting">Troubleshooting</a></li>
110 </ul>
111 </blockquote>
113 <!-- ------------------------------------------------------ -->
114 <hr>
115 <h2><a name="hg">Use of Mercurial</a></h2>
116 <blockquote>
117 The OpenJDK sources are maintained with the revision control system
118 <a href="http://mercurial.selenic.com/wiki/Mercurial">Mercurial</a>.
119 If you are new to Mercurial, please see the
120 <a href="http://mercurial.selenic.com/wiki/BeginnersGuides">Beginner Guides</a>
121 or refer to the <a href="http://hgbook.red-bean.com/">Mercurial Book</a>.
122 The first few chapters of the book provide an excellent overview of
123 Mercurial, what it is and how it works.
124 <br>
125 For using Mercurial with the OpenJDK refer to the
126 <a href="http://openjdk.java.net/guide/repositories.html#installConfig">
127 Developer Guide: Installing and Configuring Mercurial</a>
128 section for more information.
130 <!-- ------------------------------------------------------ -->
131 <h3><a name="get_source">Getting the Source</a></h3>
132 <blockquote>
133 To get the entire set of OpenJDK Mercurial repositories
134 use the script <code>get_source.sh</code> located in the root repository:
135 <blockquote>
136 <tt>
137 hg clone http://hg.openjdk.java.net/jdk8/jdk8 <i>YourOpenJDK</i>
138 <br>cd <i>YourOpenJDK</i>
139 <br>sh ./get_source.sh
140 </tt>
141 </blockquote>
142 Once you have all the repositories, the
143 script <tt>make/scripts/hgforest.sh</tt>
144 can be used to repeat the same <tt>hg</tt>
145 command on every repository in the forest, e.g.
146 <blockquote>
147 <tt>
148 cd <i>YourOpenJDK</i>
149 <br>sh ./make/scripts/hgforest.sh pull -u
150 </tt>
151 </blockquote>
152 </blockquote>
154 </blockquote>
156 <!-- ------------------------------------------------------ -->
157 <hr>
158 <h2><a name="MBE">Minimum Build Environments</a></h2>
159 <blockquote>
160 This file often describes specific requirements for what we call the
161 "minimum build environments" (MBE) for this
162 specific release of the JDK,
163 Building with the MBE will generate the most compatible
164 bits that install on, and run correctly on, the most variations
165 of the same base OS and hardware architecture.
166 These usually represent what is often called the
167 least common denominator platforms.
168 It is understood that most developers will NOT be using these
169 specific platforms, and in fact creating these specific platforms
170 may be difficult due to the age of some of this software.
171 <p>
172 The minimum OS and C/C++ compiler versions needed for building the
173 OpenJDK:
174 <p>
175 <table border="1">
176 <thead>
177 <tr>
178 <th>Base OS and Architecture</th>
179 <th>OS</th>
180 <th>C/C++ Compiler</th>
181 <th>BOOT JDK</th>
182 </tr>
183 </thead>
184 <tbody>
185 <tr>
186 <td>Linux X86 (32-bit)</td>
187 <td>Fedora 9</td>
188 <td>gcc 4.3 </td>
189 <td>JDK 6u18</td>
190 </tr>
191 <tr>
192 <td>Linux X64 (64-bit)</td>
193 <td>Fedora 9</td>
194 <td>gcc 4.3 </td>
195 <td>JDK 6u18</td>
196 </tr>
197 <tr>
198 <td>Solaris SPARC (32-bit)</td>
199 <td>Solaris 10 Update 6</td>
200 <td>Sun Studio 12 Update 1 + patches</td>
201 <td>JDK 6u18</td>
202 </tr>
203 <tr>
204 <td>Solaris SPARCV9 (64-bit)</td>
205 <td>Solaris 10 Update 6</td>
206 <td>Sun Studio 12 Update 1 + patches</td>
207 <td>JDK 6u18</td>
208 </tr>
209 <tr>
210 <td>Solaris X86 (32-bit)</td>
211 <td>Solaris 10 Update 6</td>
212 <td>Sun Studio 12 Update 1 + patches</td>
213 <td>JDK 6u18</td>
214 </tr>
215 <tr>
216 <td>Solaris X64 (64-bit)</td>
217 <td>Solaris 10 Update 6</td>
218 <td>Sun Studio 12 Update 1 + patches</td>
219 <td>JDK 6u18</td>
220 </tr>
221 <tr>
222 <td>Windows X86 (32-bit)</td>
223 <td>Windows XP</td>
224 <td>Microsoft Visual Studio C++ 2010 Professional Edition</td>
225 <td>JDK 6u18</td>
226 </tr>
227 <tr>
228 <td>Windows X64 (64-bit)</td>
229 <td>Windows Server 2003 - Enterprise x64 Edition</td>
230 <td>Microsoft Visual Studio C++ 2010 Professional Edition</td>
231 <td>JDK 6u18</td>
232 </tr>
233 </tbody>
234 </table>
235 <p>
236 These same sources do indeed build on many more systems than the
237 above older generation systems, again the above is just a minimum.
238 <p>
239 Compilation problems with newer or different C/C++ compilers is a
240 common problem.
241 Similarly, compilation problems related to changes to the
242 <tt>/usr/include</tt> or system header files is also a
243 common problem with newer or unreleased OS versions.
244 Please report these types of problems as bugs so that they
245 can be dealt with accordingly.
246 </blockquote>
247 <!-- ------------------------------------------------------ -->
248 <hr>
249 <h2><a name="SDBE">Specific Developer Build Environments</a></h2>
250 <blockquote>
251 We won't be listing all the possible environments, but
252 we will try to provide what information we have available to us.
253 </blockquote>
254 <!-- ------------------------------------------------------ -->
255 <h3><a name="fedora">Fedora</a></h3>
256 <blockquote>
257 <h4>Fedora 9</h4>
258 <p>
259 <blockquote>
260 After installing <a href="http://fedoraproject.org">Fedora</a> 9
261 you need to install several build dependencies. The simplest
262 way to do it is to execute the following commands as user
263 <tt>root</tt>:
264 <p/>
265 <code>yum-builddep java-1.6.0-openjdk</code>
266 <p/>
267 <code>yum install gcc gcc-c++</code>
268 <p/>
269 In addition, it's necessary to set a few environment variables for the build:
271 <p/>
272 <code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk</code>
273 </blockquote>
274 <h4>Fedora 10</h4>
275 <p>
276 <blockquote>
277 After installing <a href="http://fedoraproject.org">Fedora</a> 10
278 you need to install several build dependencies. The simplest
279 way to do it is to execute the following commands as user
280 <tt>root</tt>:
281 <p/>
282 <code>yum-builddep java-1.6.0-openjdk</code>
283 <p/>
284 <code>yum install gcc gcc-c++</code>
285 <p/>
286 In addition, it's necessary to set a few environment variables for the build:
288 <p/>
289 <code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk</code>
290 </blockquote>
291 <h4>Fedora 11</h4>
292 <p>
293 <blockquote>
294 After installing <a href="http://fedoraproject.org">Fedora</a> 11
295 you need to install several build dependencies. The simplest
296 way to do it is to execute the following commands as user
297 <tt>root</tt>:
298 <p/>
299 <code>yum-builddep java-1.6.0-openjdk</code>
300 <p/>
301 <code>yum install gcc gcc-c++</code>
302 <p/>
303 In addition, it's necessary to set a few environment variables for the build:
305 <p/>
306 <code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk</code>
307 </blockquote>
308 </blockquote>
309 <!-- ------------------------------------------------------ -->
310 <h3><a name="centos">CentOS 5.5</a></h3>
311 <blockquote>
312 After installing
313 <a href="http://www.centos.org/">CentOS 5.5</a>
314 you need to make sure you have
315 the following Development bundles installed:
316 <blockquote>
317 <ul>
318 <li>Development Libraries</li>
319 <li>Development Tools</li>
320 <li>Java Development</li>
321 <li>X Software Development (Including XFree86-devel)</li>
322 </ul>
323 </blockquote>
324 <p>
325 Plus the following packages:
326 <blockquote>
327 <ul>
328 <li>cups devel: Cups Development Package</li>
329 <li>alsa devel: Alsa Development Package</li>
330 <li>ant: Ant Package</li>
331 <li>Xi devel: libXi.so Development Package</li>
332 </ul>
333 </blockquote>
334 <p>
335 The freetype 2.3 packages don't seem to be available,
336 but the freetype 2.3 sources can be downloaded, built,
337 and installed easily enough from
338 <a href="http://downloads.sourceforge.net/freetype">
339 the freetype site</a>.
340 Build and install with something like:
341 <blockquote>
342 <tt>./configure && make && sudo -u root make install</tt>
343 </blockquote>
344 <p>
345 Mercurial packages could not be found easily, but a Google
346 search should find ones, and they usually include Python if
347 it's needed.
348 </blockquote>
349 <!-- ------------------------------------------------------ -->
350 <h3><a name="debian">Debian</a></h3>
351 <blockquote>
352 <h4>Debian 5.0 (Lenny)</h4>
353 <p>
354 <blockquote>
355 After installing <a href="http://debian.org">Debian</a> 5
356 you need to install several build dependencies.
357 The simplest way to install the build dependencies is to
358 execute the following commands as user <tt>root</tt>:
359 <p/>
360 <code>aptitude build-dep openjdk-6</code>
361 <p/>
362 <code>aptitude install openjdk-6-jdk libmotif-dev</code>
363 <p/>
364 In addition, it's necessary to set a few environment variables for the build:
365 <p/>
366 <code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
367 </blockquote>
368 </blockquote>
369 <!-- ====================================================== -->
370 <h3><a name="ubuntu">Ubuntu</a></h3>
371 <blockquote>
372 <h4>Ubuntu 8.04</h4>
373 <p>
374 <blockquote>
375 After installing <a href="http://ubuntu.org">Ubuntu</a> 8.04
376 you need to install several build dependencies.
377 <p/>
378 First, you need to enable the universe repository in the
379 Software Sources application and reload the repository
380 information. The Software Sources application is available
381 under the System/Administration menu.
382 <p/>
383 The simplest way to install the build dependencies is to
384 execute the following commands:
385 <p/>
386 <code>sudo aptitude build-dep openjdk-6</code>
387 <p/>
388 <code>sudo aptitude install openjdk-6-jdk</code>
389 <p/>
390 In addition, it's necessary to set a few environment variables for the build:
391 <p/>
392 <code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
393 </blockquote>
394 <h4>Ubuntu 8.10</h4>
395 <p>
396 <blockquote>
397 After installing <a href="http://ubuntu.org">Ubuntu</a> 8.10
398 you need to install several build dependencies. The simplest
399 way to do it is to execute the following commands:
400 <p/>
401 <code>sudo aptitude build-dep openjdk-6</code>
402 <p/>
403 <code>sudo aptitude install openjdk-6-jdk</code>
404 <p/>
405 In addition, it's necessary to set a few environment variables for the build:
406 <p/>
407 <code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
408 </blockquote>
409 <h4>Ubuntu 9.04</h4>
410 <p>
411 <blockquote>
412 After installing <a href="http://ubuntu.org">Ubuntu</a> 9.04
413 you need to install several build dependencies. The simplest
414 way to do it is to execute the following commands:
415 <p/>
416 <code>sudo aptitude build-dep openjdk-6</code>
417 <p/>
418 <code>sudo aptitude install openjdk-6-jdk</code>
419 <p/>
420 In addition, it's necessary to set a few environment variables for the build:
421 <p/>
422 <code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
423 </blockquote>
424 </blockquote>
425 <!-- ====================================================== -->
426 <h3><a name="opensuse">OpenSUSE</a></h3>
427 <blockquote>
428 <h4>OpenSUSE 11.1</h4>
429 <p>
430 <blockquote>
431 After installing <a href="http://opensuse.org">OpenSUSE</a> 11.1
432 you need to install several build dependencies.
433 The simplest way to install the build dependencies is to
434 execute the following commands:
435 <p/>
436 <code>sudo zypper source-install -d java-1_6_0-openjdk</code>
437 <p/>
438 <code>sudo zypper install make</code>
439 <p/>
440 In addition, it is necessary to set a few environment variables for the build:
441 <p/>
442 <code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk</code>
443 <p/>
444 Finally, you need to unset the <code>JAVA_HOME</code> environment variable:
445 <p/>
446 <code>export -n JAVA_HOME</code>
447 </blockquote>
448 </blockquote>
449 <!-- ====================================================== -->
450 <h3><a name="mandriva">Mandriva</a></h3>
451 <blockquote>
452 <h4>Mandriva Linux One 2009 Spring</h4>
453 <p>
454 <blockquote>
455 After installing <a href="http://mandriva.org">Mandriva</a> Linux One 2009 Spring
456 you need to install several build dependencies.
457 The simplest way to install the build dependencies is to
458 execute the following commands as user <tt>root</tt>:
459 <p/>
460 <code>urpmi java-1.6.0-openjdk-devel ant make gcc gcc-c++ freetype-devel zip unzip libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel libxtst6-devel libxi-devel</code>
461 <p/>
462 In addition, it is necessary to set a few environment variables for the build:
463 <p/>
464 <code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk</code>
465 </blockquote>
466 </blockquote>
467 <!-- ====================================================== -->
468 <h3><a name="opensolaris">OpenSolaris</a></h3>
469 <blockquote>
470 <h4>OpenSolaris 2009.06</h4>
471 <p>
472 <blockquote>
473 After installing <a href="http://opensolaris.org">OpenSolaris</a> 2009.06
474 you need to install several build dependencies.
475 The simplest way to install the build dependencies is to
476 execute the following commands:
477 <p/>
478 <code>pfexec pkg install SUNWgmake SUNWj6dev SUNWant sunstudioexpress SUNWcups SUNWzip SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2</code>
479 <p/>
480 In addition, it is necessary to set a few environment variables for the build:
481 <p/>
482 <code>export LANG=C ALT_COMPILER_PATH=/opt/SunStudioExpress/bin/ ALT_CUPS_HEADERS_PATH=/usr/include/</code>
483 <p/>
484 Finally, you need to make sure that the build process can find the Sun Studio compilers:
485 <p/>
486 <code>export PATH=$PATH:/opt/SunStudioExpress/bin/</code>
487 </blockquote>
488 </blockquote>
489 <!-- ------------------------------------------------------ -->
490 <hr>
491 <h2><a name="directories">Source Directory Structure</a></h2>
492 <blockquote>
493 <p>
494 The source code for the OpenJDK is delivered in a set of
495 directories:
496 <tt>hotspot</tt>,
497 <tt>langtools</tt>,
498 <tt>corba</tt>,
499 <tt>jaxws</tt>,
500 <tt>jaxp</tt>,
501 and
502 <tt>jdk</tt>.
503 The <tt>hotspot</tt> directory contains the source code and make
504 files for building the OpenJDK Hotspot Virtual Machine.
505 The <tt>langtools</tt> directory contains the source code and make
506 files for building the OpenJDK javac and language tools.
507 The <tt>corba</tt> directory contains the source code and make
508 files for building the OpenJDK Corba files.
509 The <tt>jaxws</tt> directory contains the source code and make
510 files for building the OpenJDK JAXWS files.
511 The <tt>jaxp</tt> directory contains the source code and make
512 files for building the OpenJDK JAXP files.
513 The <tt>jdk</tt> directory contains the source code and make files for
514 building the OpenJDK runtime libraries and misc files.
515 The top level <tt>Makefile</tt>
516 is used to build the entire OpenJDK.
518 <h3><a name="drops">Managing the Source Drops</a></h3>
519 <blockquote>
520 <p>
521 The repositories <tt>jaxp</tt> and <tt>jaxws</tt> actually
522 do not contain the sources for JAXP or JAX-WS.
523 These products have their own open source procedures at their
524 <a href="http://jaxp.java.net/">JAXP</a> and
525 <a href="http://jax-ws.java.net/">JAX-WS</a> home pages.
526 The OpenJDK project does need access to these sources to build
527 a complete JDK image because JAXP and JAX-WS are part of the JDK.
528 The current process for delivery of the JAXP and JAX-WS sources
529 involves so called "source drop bundles" downloaded from a public
530 website.
531 There are many reasons for this current mechanism, and it is
532 understood that this is not ideal for the open source community.
533 It is possible this process could change in the future.
534 <br>
535 <b>NOTE:</b> The <a href="http://download.java.net/openjdk/jdk8/">
536 Complete OpenJDK Source Bundles</a> <u>will</u> contain the JAXP and
537 JAX-WS sources.
538 </p>
540 <h4><a name="dropcreation">Creation of New Source Drop Bundles</a></h4>
541 <blockquote>
542 <ol>
543 <li>
544 The JAXP or JAX-WS team prepares a new zip bundle,
545 places a copy in a public download area on java.net,
546 sends us a link and a list of CRs (Change Request Numbers).
547 The older download bundles should not be deleted.
548 It is the responsibility of the JAXP and JAX-WS team to
549 place the proper GPL legal notices on the sources
550 and do any filtering or java re-packaging for the
551 OpenJDK instances of these classes.
552 </li>
553 <li>
554 The OpenJDK team copies this new bundle into shared
555 area (e.g. <tt>/java/devtools/share/jdk8-drops</tt>).
556 Older bundles are never deleted so we retain the history.
557 </li>
558 <li>
559 The OpenJDK team edits the ant property file
560 <tt>jaxp/jaxp.properties</tt> or
561 <tt>jaxws/jaxws.properties</tt> to update the
562 base URL, the zip bundle name, and the MD5 checksum
563 of the zip bundle
564 (on Solaris: <tt>sum -c md5 <i>bundlename</i></tt>)
565 </li>
566 <li>
567 OpenJDK team reviews and commits those changes with the
568 given CRs.
569 </li>
570 </ol>
571 </blockquote>
573 <h4><a name="dropusage">Using Source Drop Bundles</a></h4>
574 <blockquote>
575 <p>
576 The ant scripts that build <tt>jaxp</tt> and <tt>jaxws</tt>
577 will attempt to locate these zip bundles from the directory
578 in the environment variable
579 <tt><a href="#ALT_DROPS_DIR">ALT_DROPS_DIR</a></tt>.
580 The checksums protect from getting the wrong, corrupted, or
581 improperly modified sources.
582 Once the sources are made available, the population will not
583 happen again unless a <tt>make clobber</tt> is requested
584 or the <tt>jaxp/drop/</tt> or <tt>jaxws/drop/</tt>
585 directory is explicitly deleted.
586 <br>
587 <b>NOTE:</b> The default Makefile and ant script behavior
588 is to NOT download these bundles from the public http site.
589 In general, doing downloads
590 during the build process is not advised, it creates too much
591 unpredictability in the build process.
592 However, you can use <tt>make ALLOW_DOWNLOADS=true</tt> to
593 tell the ant script that the download of the zip bundle is
594 acceptable.
595 </p>
596 <p>
597 The recommended procedure for keeping a cache of these
598 source bundles would be to download them once, place them
599 in a directory outside the repositories, and then set
600 <tt><a href="#ALT_DROPS_DIR">ALT_DROPS_DIR</a></tt> to refer
601 to that directory.
602 These drop bundles do change occasionally, so the newer
603 bundles may need to be added to this area from time to time.
604 </p>
605 </blockquote>
606 </blockquote>
607 </blockquote>
608 <!-- ------------------------------------------------------ -->
609 <hr>
610 <h2><a name="building">Build Information</a></h2>
611 <blockquote>
612 Building the OpenJDK
613 is done with a <a href="#gmake">GNU <tt>make</tt></a> command line
614 and various
615 environment or make variable settings that direct the makefile rules
616 to where various components have been installed.
617 Where possible the makefiles will attempt to located the various
618 components in the default locations or any component specific
619 variable settings.
620 When the normal defaults fail or components cannot be found,
621 the various
622 <tt>ALT_*</tt> variables (alternates)
623 can be used to help the makefiles locate components.
624 <p>
625 Refer to the bash/sh/ksh setup file
626 <tt>jdk/make/jdk_generic_profile.sh</tt>
627 if you need help in setting up your environment variables.
628 A build could be as simple as:
629 <blockquote>
630 <pre><tt>
631 bash
632 . jdk/make/jdk_generic_profile.sh
633 <a href="#gmake"><tt>make</tt></a> sanity && <a href="#gmake"><tt>make</tt></a>
634 </tt></pre>
635 </blockquote>
636 <p>
637 Of course ksh or sh would work too.
638 But some customization will probably be necessary.
639 The <tt>sanity</tt> rule will make some basic checks on build
640 dependencies and generate appropriate warning messages
641 regarding missing, out of date, or newer than expected components
642 found on your system.
643 </blockquote>
644 <!-- ------------------------------------------------------ -->
645 <hr>
646 <h3><a name="gmake">GNU make (<tt><i>gmake</i></tt>)</a></h3>
647 <blockquote>
648 The Makefiles in the OpenJDK are only valid when used with the
649 GNU version of the utility command <tt>make</tt>
650 (<tt><i>gmake</i></tt>).
651 A few notes about using GNU make:
652 <ul>
653 <li>
654 You need GNU make version 3.81 or newer.
655 </li>
656 <li>
657 Place the location of the GNU make binary in the <tt>PATH</tt>.
658 </li>
659 <li>
660 <strong>Linux:</strong>
661 The <tt>/usr/bin/make</tt> should be 3.81 or newer
662 and should work fine for you.
663 If this version is not 3.81 or newer,
664 see the <a href="#buildgmake">"Building GNU make"</a> section.
665 </li>
666 <li>
667 <strong>Solaris:</strong>
668 Do NOT use <tt>/usr/bin/make</tt> on Solaris.
669 If your Solaris system has the software
670 from the Solaris Companion CD installed,
671 you should try and use <tt>gmake</tt>
672 which will be located in either the <tt>/opt/sfw/bin</tt> or
673 <tt>/usr/sfw/bin</tt> directory.
674 In more recent versions of Solaris GNU make might be found
675 at <tt>/usr/bin/gmake</tt>.<br>
676 <b>NOTE:</b> It is very likely that this <tt>gmake</tt>
677 could be 3.80, you need 3.81, in which case,
678 see the <a href="#buildgmake">"Building GNU make"</a> section.
679 </li>
680 <li>
681 <strong>Windows:</strong>
682 Make sure you start your build inside a bash/sh/ksh shell
683 and are using a <tt>make.exe</tt> utility built for that
684 environment (a cygwin <tt>make.exe</tt> is not the same
685 as a <tt>make.exe</tt> built for something like
686 <a href="http://www.mkssoftware.com/">MKS</a>).
687 <br>
688 <b>WARNING:</b> Watch out on some make 3.81 versions, it may
689 not work due to a lack of support for MS-DOS drive letter paths
690 like <tt>C:/</tt> or <tt>C:\</tt>.
691 <br>
692 You may be able to use the information at the
693 <a href="http://developer.mozilla.org/en/docs/Windows_build_prerequisites_using_cygwin#make" target="_blank">
694 mozilla developer center</a>
695 on this topic.
696 <br>
697 It's hoped that when make 3.82 starts shipping in a future cygwin
698 release that this MS-DOS path issue will be fixed.
699 <br>
700 It may be possible to download the version at
701 <a href="http://www.cmake.org/files/cygwin/make.exe">
702 www.cmake.org make.exe</a>.
703 <br>
704 It might be necessary for you to build your own GNU make 3.81,
705 see the <a href="#buildgmake">"Building GNU make"</a> section
706 in that case.
707 </li>
708 </ul>
709 <p>
710 Information on GNU make, and access to ftp download sites, are
711 available on the
712 <a href="http://www.gnu.org/software/make/make.html" target="_blank">
713 GNU make web site
714 </a>.
715 The latest source to GNU make is available at
716 <a href="http://ftp.gnu.org/pub/gnu/make/" target="_blank">
717 ftp.gnu.org/pub/gnu/make/</a>.
718 </p>
719 <!-- ------------------------------------------------------ -->
720 <h4><a name="buildgmake">Building GNU make</a></h4>
721 <blockquote>
722 First step is to get the GNU make 3.81 source from
723 <a href="http://ftp.gnu.org/pub/gnu/make/" target="_blank">
724 ftp.gnu.org/pub/gnu/make/</a>.
725 Building is a little different depending on the OS and unix toolset
726 on Windows:
727 <ul>
728 <li>
729 <strong>Linux:</strong>
730 <tt>./configure && make</tt>
731 </li>
732 <li>
733 <strong>Solaris:</strong>
734 <tt>./configure && gmake CC=gcc</tt>
735 </li>
736 <li>
737 <strong>Windows for CYGWIN:</strong>
738 <tt>./configure && make</tt>
739 </li>
740 <li>
741 <strong>Windows for MKS: (CYGWIN is recommended)</strong>
742 <tt>./configure && make -f Makefile.win32</tt>
743 </li>
744 </ul>
745 </blockquote>
746 </blockquote>
747 <!-- ------------------------------------------------------ -->
748 <hr>
749 <h3><a name="linux">Basic Linux System Setup</a></h3>
750 <blockquote>
751 <strong>i586 only:</strong>
752 The minimum recommended hardware for building the Linux version
753 is a Pentium class processor or better, at least 256 MB of RAM, and
754 approximately 1.5 GB of free disk space.
755 <p>
756 <strong>X64 only:</strong>
757 The minimum recommended hardware for building the Linux
758 version is an AMD Opteron class processor, at least 512 MB of RAM, and
759 approximately 4 GB of free disk space.
760 <p>
761 The build will use the tools contained in
762 <tt>/bin</tt> and
763 <tt>/usr/bin</tt>
764 of a standard installation of the Linux operating environment.
765 You should ensure that these directories are in your
766 <tt>PATH</tt>.
767 <p>
768 Note that some Linux systems have a habit of pre-populating
769 your environment variables for you, for example <tt>JAVA_HOME</tt>
770 might get pre-defined for you to refer to the JDK installed on
771 your Linux system.
772 You will need to unset <tt>JAVA_HOME</tt>.
773 It's a good idea to run <tt>env</tt> and verify the
774 environment variables you are getting from the default system
775 settings make sense for building the
776 OpenJDK.
777 </blockquote>
778 <!-- ------------------------------------------------------ -->
779 <h4><a name="linux_checklist">Basic Linux Check List</a></h4>
780 <blockquote>
781 <ol>
782 <li>
783 Install the
784 <a href="#bootjdk">Bootstrap JDK</a>, set
785 <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>.
786 </li>
787 <li>
788 <a href="#importjdk">Optional Import JDK</a>, set
789 <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>.
790 </li>
791 <li>
792 Install or upgrade the <a href="#freetype">FreeType development
793 package</a>.
794 </li>
795 <li>
796 Install
797 <a href="#ant">Ant 1.7.1 or newer</a>,
798 make sure it is in your PATH.
799 </li>
800 </ol>
801 </blockquote>
802 <!-- ------------------------------------------------------ -->
803 <hr>
804 <h3><a name="solaris">Basic Solaris System Setup</a></h3>
805 <blockquote>
806 The minimum recommended hardware for building the
807 Solaris SPARC version is an UltraSPARC with 512 MB of RAM.
808 For building
809 the Solaris x86 version, a Pentium class processor or better and at
810 least 512 MB of RAM are recommended.
811 Approximately 1.4 GB of free disk
812 space is needed for a 32-bit build.
813 <p>
814 If you are building the 64-bit version, you should
815 run the command "isainfo -v" to verify that you have a
816 64-bit installation, it should say <tt>sparcv9</tt> or
817 <tt>amd64</tt>.
818 An additional 7 GB of free disk space is needed
819 for a 64-bit build.
820 <p>
821 The build uses the tools contained in <tt>/usr/ccs/bin</tt>
822 and <tt>/usr/bin</tt> of a standard developer or full installation of
823 the Solaris operating environment.
824 <p>
825 Solaris patches specific to the JDK can be downloaded from the
826 <a href="http://sunsolve.sun.com/show.do?target=patches/JavaSE" target="_blank">
827 SunSolve JDK Solaris patches download page</a>.
828 You should ensure that the latest patch cluster for
829 your version of the Solaris operating environment has also
830 been installed.
831 </blockquote>
832 <!-- ------------------------------------------------------ -->
833 <h4><a name="solaris_checklist">Basic Solaris Check List</a></h4>
834 <blockquote>
835 <ol>
836 <li>
837 Install the
838 <a href="#bootjdk">Bootstrap JDK</a>, set
839 <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>.
840 </li>
841 <li>
842 <a href="#importjdk">Optional Import JDK</a>, set
843 <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>.
844 </li>
845 <li>
846 Install the
847 <a href="#studio">Sun Studio Compilers</a>, set
848 <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>.
849 </li>
850 <li>
851 Install the
852 <a href="#cups">CUPS Include files</a>, set
853 <tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>.
854 </li>
855 <li>
856 Install the <a href="#xrender">XRender Include files</a>.
857 </li>
858 <li>
859 Install
860 <a href="#ant">Ant 1.7.1 or newer</a>,
861 make sure it is in your PATH.
862 </li>
863 </ol>
864 </blockquote>
865 <!-- ------------------------------------------------------ -->
866 <hr>
867 <h3><a name="windows">Basic Windows System Setup</a></h3>
868 <blockquote>
869 <strong>i586 only:</strong>
870 The minimum recommended hardware for building the 32-bit or X86
871 Windows version is an Pentium class processor or better, at least
872 512 MB of RAM, and approximately 600 MB of free disk space.
873 <strong>
874 NOTE: The Windows build machines need to use the
875 file system NTFS.
876 Build machines formatted to FAT32 will not work
877 because FAT32 doesn't support case-sensitivity in file names.
878 </strong>
879 <p>
880 <strong>X64 only:</strong>
881 The minimum recommended hardware for building
882 the Windows X64 version is an AMD Opteron class processor, at least 1
883 GB of RAM, and approximately 10 GB of free disk space.
884 </blockquote>
885 <!-- ------------------------------------------------------ -->
886 <h4><a name="paths">Windows Paths</a></h4>
887 <blockquote>
888 <strong>Windows:</strong>
889 Note that GNU make is a historic utility and is based very
890 heavily on shell scripting, so it does not tolerate the Windows habit
891 of having spaces in pathnames or the use of the <tt>\</tt>characters in pathnames.
892 Luckily on most Windows systems, you can use <tt>/</tt>instead of \, and
893 there is always a 'short' pathname without spaces for any path that
894 contains spaces.
895 Unfortunately, this short pathname can be somewhat dynamic and the
896 formula is difficult to explain.
897 You can use <tt>cygpath</tt> utility to map pathnames with spaces
898 or the <tt>\</tt>character into the <tt>C:/</tt> style of pathname
899 (called 'mixed'), e.g.
900 <tt>cygpath -s -m "<i>path</i>"</tt>.
901 <p>
902 The makefiles will try to translate any pathnames supplied
903 to it into the <tt>C:/</tt> style automatically.
904 <p>
905 Note that use of CYGWIN creates a unique problem with regards to
906 setting <a href="#path"><tt>PATH</tt></a>. Normally on Windows
907 the <tt>PATH</tt> variable contains directories
908 separated with the ";" character (Solaris and Linux uses ":").
909 With CYGWIN, it uses ":", but that means that paths like "C:/path"
910 cannot be placed in the CYGWIN version of <tt>PATH</tt> and
911 instead CYGWIN uses something like <tt>/cygdrive/c/path</tt>
912 which CYGWIN understands, but only CYGWIN understands.
913 So be careful with paths on Windows.
914 </blockquote>
915 <!-- ------------------------------------------------------ -->
916 <h4><a name="windows_checklist">Basic Windows Check List</a></h4>
917 <blockquote>
918 <ol>
919 <li>
920 Install the
921 <a href="#cygwin">CYGWIN product</a>.
922 </li>
923 <li>
924 Install the
925 <a href="#bootjdk">Bootstrap JDK</a>, set
926 <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>.
927 </li>
928 <li>
929 <a href="#importjdk">Optional Import JDK</a>, set
930 <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>.
931 </li>
932 <li>
933 Install the
934 <a href="#msvc32">Microsoft Visual Studio Compilers</a>).
935 </li>
936 <li>
937 Setup all environment variables for compilers
938 (see <a href="#msvc32">compilers</a>).
939 </li>
940 <li>
941 Install
942 <a href="#dxsdk">Microsoft DirectX SDK</a>.
943 </li>
944 <li>
945 Install
946 <a href="#ant">Ant 1.7.1 or newer</a>,
947 make sure it is in your PATH and set
948 <tt><a href="#ANT_HOME">ANT_HOME</a></tt>.
949 </li>
950 </ol>
951 </blockquote>
952 <!-- ------------------------------------------------------ -->
953 <hr>
954 <h3><a name="dependencies">Build Dependencies</a></h3>
955 <blockquote>
956 Depending on the platform, the OpenJDK build process has some basic
957 dependencies on components not part of the OpenJDK sources.
958 Some of these are specific to a platform, some even specific to
959 an architecture.
960 Each dependency will have a set of ALT variables that can be set
961 to tell the makefiles where to locate the component.
962 In most cases setting these ALT variables may not be necessary
963 and the makefiles will find defaults on the system in standard
964 install locations or through component specific variables.
965 <!-- ------------------------------------------------------ -->
966 <h4><a name="bootjdk">Bootstrap JDK</a></h4>
967 <blockquote>
968 All OpenJDK builds require access to the previously released
969 JDK 6, this is often called a bootstrap JDK.
970 The JDK 6 binaries can be downloaded from Sun's
971 <a href="http://java.sun.com/javase/downloads/index.jsp"
972 target="_blank">JDK 6 download site</a>.
973 For build performance reasons
974 is very important that this bootstrap JDK be made available on the
975 local disk of the machine doing the build.
976 You should always set
977 <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>
978 to point to the location of
979 the bootstrap JDK installation, this is the directory pathname
980 that contains a <tt>bin, lib, and include</tt>
981 It's also a good idea to also place its <tt>bin</tt> directory
982 in the <tt>PATH</tt> environment variable, although it's
983 not required.
984 <p>
985 <strong>Solaris:</strong>
986 Some pre-installed JDK images may be available to you in the
987 directory <tt>/usr/jdk/instances</tt>.
988 If you don't set
989 <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>
990 the makefiles will look in that location for a JDK it can use.
991 </blockquote>
992 <!-- ------------------------------------------------------ -->
993 <h4><a name="importjdk">Optional Import JDK</a></h4>
994 <blockquote>
995 The <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>
996 setting is only needed if you are not building the entire
997 JDK. For example, if you have built the entire JDK once, and
998 wanted to avoid repeatedly building the Hotspot VM, you could
999 set this to the location of the previous JDK install image
1000 and the build will copy the needed files from this import area.
1001 </blockquote>
1002 <!-- ------------------------------------------------------ -->
1003 <h4><a name="ant">Ant</a></h4>
1004 <blockquote>
1005 All OpenJDK builds require access to least Ant 1.7.1.
1006 The Ant tool is available from the
1007 <a href="http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.zip" target="_blank">
1008 Ant 1.7.1 archive download site</a>.
1009 You should always make sure <tt>ant</tt> is in your PATH, and
1010 on Windows you may also need to set
1011 <tt><a href="#ANT_HOME">ANT_HOME</a></tt>
1012 to point to the location of
1013 the Ant installation, this is the directory pathname
1014 that contains a <tt>bin and lib</tt>.
1015 <br>
1016 <b>WARNING:</b> Ant versions used from IDE tools like NetBeans
1017 or installed via system packages may not operate the same
1018 as the one obtained from the Ant download bundles.
1019 These system and IDE installers sometimes choose to change
1020 the ant installation enough to cause differences.
1021 </blockquote>
1022 <!-- ------------------------------------------------------ -->
1023 <h4><a name="cacerts">Certificate Authority File (cacert)</a></h4>
1024 <blockquote>
1025 See <a href="http://en.wikipedia.org/wiki/Certificate_Authority" target="_blank">
1026 http://en.wikipedia.org/wiki/Certificate_Authority</a>
1027 for a better understanding of the Certificate Authority (CA).
1028 A certificates file named "cacerts"
1029 represents a system-wide keystore with CA certificates.
1030 In JDK and JRE
1031 binary bundles, the "cacerts" file contains root CA certificates from
1032 several public CAs (e.g., VeriSign, Thawte, and Baltimore).
1033 The source contain a cacerts file
1034 without CA root certificates.
1035 Formal JDK builders will need to secure
1036 permission from each public CA and include the certificates into their
1037 own custom cacerts file.
1038 Failure to provide a populated cacerts file
1039 will result in verification errors of a certificate chain during runtime.
1040 The variable
1041 <tt><a href="#ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt>
1042 can be used to override the default location of the
1043 cacerts file that will get placed in your build.
1044 By default an empty cacerts file is provided and that should be
1045 fine for most JDK developers.
1046 </blockquote>
1047 <!-- ------------------------------------------------------ -->
1048 <h4><a name="compilers">Compilers</a></h4>
1049 <blockquote>
1050 <strong><a name="gcc">Linux gcc/binutils</a></strong>
1051 <blockquote>
1052 The GNU gcc compiler version should be 4.3 or newer.
1053 The compiler used should be the default compiler installed
1054 in <tt>/usr/bin</tt>.
1055 </blockquote>
1056 <strong><a name="studio">Solaris: Sun Studio</a></strong>
1057 <blockquote>
1058 At a minimum, the
1059 <a href="http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.htm" target="_blank">
1060 Sun Studio 12 Update 1 Compilers</a>
1061 (containing version 5.10 of the C and C++ compilers) is required,
1062 including specific patches.
1063 <p>
1064 The Solaris SPARC patch list is:
1065 <ul>
1066 <li>
1067 118683-05: SunOS 5.10: Patch for profiling libraries and assembler
1068 </li>
1069 <li>
1070 119963-21: SunOS 5.10: Shared library patch for C++
1071 </li>
1072 <li>
1073 120753-08: SunOS 5.10: Microtasking libraries (libmtsk) patch
1074 </li>
1075 <li>
1076 128228-09: Sun Studio 12 Update 1: Patch for Sun C++ Compiler
1077 </li>
1078 <li>
1079 141860-03: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95
1080 </li>
1081 <li>
1082 141861-05: Sun Studio 12 Update 1: Patch for Sun C Compiler
1083 </li>
1084 <li>
1085 142371-01: Sun Studio 12.1 Update 1: Patch for dbx
1086 </li>
1087 <li>
1088 143384-02: Sun Studio 12 Update 1: Patch for debuginfo handling
1089 </li>
1090 <li>
1091 143385-02: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95
1092 </li>
1093 <li>
1094 142369-01: Sun Studio 12.1: Patch for Performance Analyzer Tools
1095 </li>
1096 </ul>
1097 <p>
1098 The Solaris X86 patch list is:
1099 <ul>
1100 <li>
1101 119961-07: SunOS 5.10_x86, x64, Patch for profiling libraries and assembler
1102 </li>
1103 <li>
1104 119964-21: SunOS 5.10_x86: Shared library patch for C++_x86
1105 </li>
1106 <li>
1107 120754-08: SunOS 5.10_x86: Microtasking libraries (libmtsk) patch
1108 </li>
1109 <li>
1110 141858-06: Sun Studio 12 Update 1_x86: Sun Compiler Common patch for x86 backend
1111 </li>
1112 <li>
1113 128229-09: Sun Studio 12 Update 1_x86: Patch for C++ Compiler
1114 </li>
1115 <li>
1116 142363-05: Sun Studio 12 Update 1_x86: Patch for C Compiler
1117 </li>
1118 <li>
1119 142368-01: Sun Studio 12.1_x86: Patch for Performance Analyzer Tools
1120 </li>
1121 </ul>
1122 <p>
1123 Set
1124 <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>
1125 to point to the location of
1126 the compiler binaries, and place this location in the <tt>PATH</tt>.
1127 <p>
1128 The Oracle Solaris Studio Express compilers at:
1129 <a href="http://developers.sun.com/sunstudio/downloads/express.jsp" target="_blank">
1130 Oracle Solaris Studio Express Download site</a>
1131 are also an option, although these compilers have not
1132 been extensively used yet.
1133 </blockquote>
1134 <strong><a name="msvc32">Windows i586: Microsoft Visual Studio 2010 Compilers</a></strong>
1135 <blockquote>
1136 <p>
1137 <b>BEGIN WARNING</b>: JDK 7 has transitioned to
1138 use the newest VS2010 Microsoft compilers.
1139 No other compilers are known to build the entire JDK,
1140 including non-open portions.
1141 Visual Studio 2010 Express compilers are now able to build all the
1142 open source repositories, but this is 32 bit only. To build 64 bit
1143 Windows binaries use the the 7.1 Windows SDK.
1144 <b>END WARNING.</b>
1145 <p>
1146 The 32-bit OpenJDK Windows build requires
1147 Microsoft Visual Studio C++ 2010 (VS2010) Professional
1148 Edition or Express compiler.
1149 The compiler and other tools are expected to reside
1150 in the location defined by the variable
1151 <tt>VS100COMNTOOLS</tt> which
1152 is set by the Microsoft Visual Studio installer.
1153 <p>
1154 Once the compiler is installed,
1155 it is recommended that you run <tt>VCVARS32.BAT</tt>
1156 to set the compiler environment variables
1157 <tt>INCLUDE</tt>,
1158 <tt>LIB</tt>, and
1159 <tt>PATH</tt>
1160 prior to building the
1161 OpenJDK.
1162 The above environment variables <b>MUST</b> be set.
1163 This compiler also contains the Windows SDK v 7.0a,
1164 which is an update to the Windows 7 SDK.
1165 <p>
1166 <b>WARNING:</b> Make sure you check out the
1167 <a href="#cygwin">CYGWIN link.exe WARNING</a>.
1168 The path <tt>/usr/bin</tt> must be after the path to the
1169 Visual Studio product.
1170 </blockquote>
1171 <strong><a name="msvc64">Windows x64: Microsoft Visual Studio 2010 Professional Compiler</a></strong>
1172 <blockquote>
1173 For <b>X64</b>, the set up is much the same as 32 bit
1174 except that you run <tt>amd64\VCVARS64.BAT</tt>
1175 to set the compiler environment variables.
1176 Previously 64 bit builds had to use the 64 bit compiler in
1177 an unbundled Windows SDK but this is no longer necessary if
1178 you have VS2010 Professional.
1179 </blockquote>
1180 <strong><a name="mssdk64">Windows x64: Microsoft Windows 7.1 SDK 64 bit compilers.</a></strong>
1181 For a free alternative for 64 bit builds, use the 7.1 SDK.
1182 Microsoft say that to set up your paths for this run
1183 <pre>
1184 c:\Program Files\Microsoft SDKs\Windows\v7.1\bin\setenv.cmd /x64.
1185 </pre>
1186 What was tested is just directly setting up LIB, INCLUDE,
1187 PATH and based on the installation directories using the
1188 DOS short name appropriate for the system, (you will
1189 need to set them for yours, not just blindly copy this) eg :
1190 <pre>
1191 set VSINSTALLDIR=c:\PROGRA~2\MICROS~1.0
1192 set WindowsSdkDir=c:\PROGRA~1\MICROS~1\Windows\v7.1
1193 set PATH=%VSINSTALLDIR%\vc\bin\amd64;%VSINSTALLDIR%\Common7\IDE;%WindowsSdkDir%\bin;%PATH%
1194 set INCLUDE=%VSINSTALLDIR%\vc\include;%WindowsSdkDir%\include
1195 set LIB=%VSINSTALLDIR%\vc\lib\amd64;%WindowsSdkDir%\lib\x64
1196 </pre>
1197 </blockquote>
1198 <!-- ------------------------------------------------------ -->
1199 <h4><a name="zip">Zip and Unzip</a></h4>
1200 <blockquote>
1201 Version 2.2 (November 3rd 1997) or newer of the zip utility
1202 and version 5.12 or newer of the unzip utility is needed
1203 to build the JDK.
1204 With Solaris, Linux, and Windows CYGWIN, the zip and unzip
1205 utilities installed on the system should be fine.
1206 Information and the source code for
1207 ZIP.EXE and UNZIP.EXE is available on the
1208 <a href="http://www.info-zip.org"
1209 target="_blank">info-zip web site</a>.
1210 </blockquote>
1211 <!-- ------------------------------------------------------ -->
1212 <h4><a name="cups">Common UNIX Printing System (CUPS) Headers (Solaris & Linux)</a></h4>
1213 <blockquote>
1214 <strong>Solaris:</strong>
1215 CUPS header files are required for building the
1216 OpenJDK on Solaris.
1217 The Solaris header files can be obtained by installing
1218 the package <strong>SFWcups</strong> from the Solaris Software
1219 Companion CD/DVD, these often will be installed into
1220 <tt>/opt/sfw/cups</tt>.
1221 <p>
1222 <strong>Linux:</strong>
1223 CUPS header files are required for building the
1224 OpenJDK on Linux.
1225 The Linux header files are usually available from a "cups"
1226 development package, it's recommended that you try and use
1227 the package provided by the particular version of Linux that
1228 you are using.
1229 <p>
1230 The CUPS header files can always be downloaded from
1231 <a href="http://www.cups.org" target="_blank">www.cups.org</a>.
1232 The variable
1233 <tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>
1234 can be used to override the default location of the
1235 CUPS Header files.
1236 </blockquote>
1237 <!-- ------------------------------------------------------ -->
1238 <h4><a name="xrender">XRender Extension Headers (Solaris & Linux)</a></h4>
1239 <blockquote>
1240 <p>
1241 <strong>Solaris:</strong>
1242 XRender header files are required for building the
1243 OpenJDK on Solaris.
1244 The XRender header file is included with the other X11 header files
1245 in the package <strong>SFWxwinc</strong> on new enough versions of
1246 Solaris and will be installed in
1247 <tt>/usr/X11/include/X11/extensions/Xrender.h</tt>
1248 </p><p>
1249 <strong>Linux:</strong>
1250 XRender header files are required for building the
1251 OpenJDK on Linux.
1252 The Linux header files are usually available from a "Xrender"
1253 development package, it's recommended that you try and use
1254 the package provided by the particular distribution of Linux that
1255 you are using.
1256 </p>
1257 </blockquote>
1258 <!-- ------------------------------------------------------ -->
1259 <h4><a name="freetype">FreeType 2</a></h4>
1260 <blockquote>
1261 Version 2.3 or newer of FreeType is required for building the OpenJDK.
1262 On Unix systems required files can be available as part of your
1263 distribution (while you still may need to upgrade them).
1264 Note that you need development version of package that
1265 includes both FreeType library and header files.
1266 <p>
1267 You can always download latest FreeType version from the
1268 <a href="http://www.freetype.org" target="_blank">FreeType website</a>.
1269 <p>
1270 Makefiles will try to pick FreeType from /usr/lib and /usr/include.
1271 In case it is installed elsewhere you will need to set environment
1272 variables
1273 <tt><a href="#ALT_FREETYPE_LIB_PATH">ALT_FREETYPE_LIB_PATH</a></tt>
1274 and
1275 <tt><a href="#ALT_FREETYPE_HEADERS_PATH">ALT_FREETYPE_HEADERS_PATH</a></tt>
1276 to refer to place where library and header files are installed.
1277 <p>
1278 Building the freetype 2 libraries from scratch is also possible,
1279 however on Windows refer to the
1280 <a href="http://freetype.freedesktop.org/wiki/FreeType_DLL">
1281 Windows FreeType DLL build instructions</a>.
1282 <p>
1283 Note that by default FreeType is built with byte code hinting
1284 support disabled due to licensing restrictions.
1285 In this case, text appearance and metrics are expected to
1286 differ from Sun's official JDK build.
1287 See
1288 <a href="http://freetype.sourceforge.net/freetype2/index.html">
1289 the SourceForge FreeType2 Home Page
1290 </a>
1291 for more information.
1292 </blockquote>
1293 <!-- ------------------------------------------------------ -->
1294 <h4><a name="alsa">Advanced Linux Sound Architecture (ALSA) (Linux only)</a></h4>
1295 <blockquote>
1296 <strong>Linux only:</strong>
1297 Version 0.9.1 or newer of the ALSA files are
1298 required for building the OpenJDK on Linux.
1299 These Linux files are usually available from an "alsa"
1300 of "libasound"
1301 development package, it's highly recommended that you try and use
1302 the package provided by the particular version of Linux that
1303 you are using.
1304 The makefiles will check this emit a sanity error if it is
1305 missing or the wrong version.
1306 <p>
1307 In particular, older Linux systems will likely not have the
1308 right version of ALSA installed, for example
1309 Redhat AS 2.1 U2 and SuSE 8.1 do not include a sufficiently
1310 recent ALSA distribution.
1311 On rpm-based systems, you can see if ALSA is installed by
1312 running this command:
1313 <pre>
1314 <tt>rpm -qa | grep alsa</tt>
1315 </pre>
1316 Both <tt>alsa</tt> and <tt>alsa-devel</tt> packages are needed.
1317 <p>
1318 If your distribution does not come with ALSA, and you can't
1319 find ALSA packages built for your particular system,
1320 you can try to install the pre-built ALSA rpm packages from
1321 <a href="http://www.freshrpms.net/" target="_blank">
1322 <tt>www.freshrpms.net</tt></a>.
1323 Note that installing a newer ALSA could
1324 break sound output if an older version of ALSA was previously
1325 installed on the system, but it will enable JDK compilation.
1326 <blockquote>
1327 Installation: execute as root<br>
1328 [i586]: <code>rpm -Uv --force alsa-lib-devel-0.9.1-rh61.i386.rpm</code><br>
1329 [x64]: <code>rpm -Uv --force alsa-lib-devel-0.9.8-amd64.x86_64.rpm</code><br>
1330 Uninstallation:<br>
1331 [i586]: <code>rpm -ev alsa-lib-devel-0.9.1-rh61</code><br>
1332 [x64]:<code>rpm -ev alsa-lib-devel-0.9.8-amd64</code><br>
1333 Make sure that you do not link to the static library
1334 (<tt>libasound.a</tt>),
1335 by verifying that the dynamic library (<tt>libasound.so</tt>) is
1336 correctly installed in <tt>/usr/lib</tt>.
1337 </blockquote>
1338 As a last resort you can go to the
1339 <a href="http://www.alsa-project.org" target="_blank">
1340 Advanced Linux Sound Architecture Site</a> and build it from
1341 source.
1342 <blockquote>
1343 Download driver and library
1344 source tarballs from
1345 <a href="http://www.alsa-project.org" target="_blank">ALSA's homepage</a>.
1346 As root, execute the following
1347 commands (you may need to adapt the version number):
1348 <pre>
1349 <tt>
1350 $ tar xjf alsa-driver-0.9.1.tar.bz2
1351 $ cd alsa-driver-0.9.1
1352 $ ./configure
1353 $ make install
1354 $ cd ..
1355 $ tar xjf alsa-lib-0.9.1.tar.bz2
1356 $ cd alsa-lib-0.9.1
1357 $ ./configure
1358 $ make install
1359 </tt>
1360 </pre>
1361 Should one of the above steps fail, refer to the documentation on
1362 ALSA's home page.
1363 </blockquote>
1364 Note that this is a minimum install that enables
1365 building the JDK platform. To actually use ALSA sound drivers, more
1366 steps are necessary as outlined in the documentation on ALSA's homepage.
1367 <p>
1368 ALSA can be uninstalled by executing <tt>make uninstall</tt> first in
1369 the <tt>alsa-lib-0.9.1</tt> directory and then in
1370 <tt>alsa-driver-0.9.1</tt>.
1371 </blockquote>
1372 There are no ALT* variables to change the assumed locations of ALSA,
1373 the makefiles will expect to find the ALSA include files and library at:
1374 <tt>/usr/include/alsa</tt> and <tt>/usr/lib/libasound.so</tt>.
1375 </blockquote>
1376 <!-- ------------------------------------------------------ -->
1377 <h4>Windows Specific Dependencies</h4>
1378 <blockquote>
1379 <strong>Unix Command Tools (<a name="cygwin">CYGWIN</a>)</strong>
1380 <blockquote>
1381 The OpenJDK requires access to a set of unix command tools
1382 on Windows which can be supplied by
1383 <a href="http://www.cygwin.com" target="_blank">CYGWIN</a>.
1384 <p>
1385 The OpenJDK build requires CYGWIN version 1.5.12 or newer.
1386 Information about CYGWIN can
1387 be obtained from the CYGWIN website at
1388 <a href="http://www.cygwin.com" target="_blank">www.cygwin.com</a>.
1389 <p>
1390 By default CYGWIN doesn't install all the tools required for building
1391 the OpenJDK.
1392 Along with the default installation, you need to install
1393 the following tools.
1394 <blockquote>
1395 <table border="1">
1396 <thead>
1397 <tr>
1398 <td>Binary Name</td>
1399 <td>Category</td>
1400 <td>Package</td>
1401 <td>Description</td>
1402 </tr>
1403 </thead>
1404 <tbody>
1405 <tr>
1406 <td>ar.exe</td>
1407 <td>Devel</td>
1408 <td>binutils</td>
1409 <td>The GNU assembler, linker and binary
1410 utilities</td>
1411 </tr>
1412 <tr>
1413 <td>make.exe</td>
1414 <td>Devel</td>
1415 <td>make</td>
1416 <td>The GNU version of the 'make' utility built for CYGWIN.<br>
1417 <b>NOTE</b>: See <a href="#gmake">the GNU make section</a></td>
1418 </tr>
1419 <tr>
1420 <td>m4.exe</td>
1421 <td>Interpreters</td>
1422 <td>m4</td>
1423 <td>GNU implementation of the traditional Unix macro
1424 processor</td>
1425 </tr>
1426 <tr>
1427 <td>cpio.exe</td>
1428 <td>Utils</td>
1429 <td>cpio</td>
1430 <td>A program to manage archives of files</td>
1431 </tr>
1432 <tr>
1433 <td>gawk.exe</td>
1434 <td>Utils</td>
1435 <td>awk</td>
1436 <td>Pattern-directed scanning and processing language</td>
1437 </tr>
1438 <tr>
1439 <td>file.exe</td>
1440 <td>Utils</td>
1441 <td>file</td>
1442 <td>Determines file type using 'magic' numbers</td>
1443 </tr>
1444 <tr>
1445 <td>zip.exe</td>
1446 <td>Archive</td>
1447 <td>zip</td>
1448 <td>Package and compress (archive) files</td>
1449 </tr>
1450 <tr>
1451 <td>unzip.exe</td>
1452 <td>Archive</td>
1453 <td>unzip</td>
1454 <td>Extract compressed files in a ZIP archive</td>
1455 </tr>
1456 <tr>
1457 <td>free.exe</td>
1458 <td>System</td>
1459 <td>procps</td>
1460 <td>Display amount of free and used memory in the system</td>
1461 </tr>
1462 </tbody>
1463 </table>
1464 </blockquote>
1465 <p>
1466 Note that the CYGWIN software can conflict with other non-CYGWIN
1467 software on your Windows system.
1468 CYGWIN provides a
1469 <a href="http://cygwin.com/faq/faq.using.html" target="_blank">FAQ</a> for
1470 known issues and problems, of particular interest is the
1471 section on
1472 <a href="http://cygwin.com/faq/faq.using.html#faq.using.bloda" target="_blank">
1473 BLODA (applications that interfere with CYGWIN)</a>.
1474 <p>
1475 <b>WARNING:</b>
1476 Be very careful with <b><tt>link.exe</tt></b>, it will conflict
1477 with the Visual Studio version. You need the Visual Studio
1478 version of <tt>link.exe</tt>, not the CYGWIN one.
1479 So it's important that the Visual Studio paths in PATH preceed
1480 the CYGWIN path <tt>/usr/bin</tt>.
1481 </blockquote>
1482 <strong><a name="dxsdk">Microsoft DirectX 9.0 SDK header files and libraries</a></strong>
1483 <blockquote>
1484 Microsoft DirectX 9.0 SDK (Summer 2004)
1485 headers are required for building
1486 OpenJDK.
1487 This SDK can be downloaded from
1488 <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FD044A42-9912-42A3-9A9E-D857199F888E&displaylang=en" target="_blank">
1489 Microsoft DirectX 9.0 SDK (Summer 2004)</a>.
1490 If the link above becomes obsolete, the SDK can be found from
1491 <a href="http://download.microsoft.com" target="_blank">the Microsoft Download Site</a>
1492 (search with "DirectX 9.0 SDK Update Summer 2004").
1493 The location of this SDK can be set with
1494 <tt><a href="#ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt>
1495 but it's normally found via the DirectX environment variable
1496 <tt>DXSDK_DIR</tt>.
1497 </blockquote>
1498 <strong><a name="msvcrNN"><tt>MSVCR100.DLL</tt></a></strong>
1499 <blockquote>
1500 The OpenJDK build requires access to a redistributable
1501 <tt>MSVCR100.DLL</tt>.
1502 This is usually picked up automatically from the redist
1503 directories of Visual Studio 2010.
1504 If this cannot be found set the
1505 <a href="#ALT_MSVCRNN_DLL_PATH"><tt>ALT_MSVCRNN_DLL_PATH</tt></a>
1506 variable to the location of this file.
1507 <p>
1508 </blockquote>
1509 </blockquote>
1510 <!-- ------------------------------------------------------ -->
1511 <hr>
1512 <h2><a name="creating">Creating the Build</a></h2>
1513 <blockquote>
1514 Once a machine is setup to build the OpenJDK,
1515 the steps to create the build are fairly simple.
1516 The various ALT settings can either be made into variables
1517 or can be supplied on the
1518 <a href="#gmake"><tt><i>gmake</i></tt></a>
1519 command.
1520 <ol>
1521 <li>Use the sanity rule to double check all the ALT settings:
1522 <blockquote>
1523 <tt>
1524 <i>gmake</i>
1525 sanity
1526 [ARCH_DATA_MODEL=<i>32 or 64</i>]
1527 [other "ALT_" overrides]
1528 </tt>
1529 </blockquote>
1530 </li>
1531 <li>Start the build with the command:
1532 <blockquote>
1533 <tt>
1534 <i>gmake</i>
1535 [ARCH_DATA_MODEL=<i>32 or 64</i>]
1536 [ALT_OUTPUTDIR=<i>output_directory</i>]
1537 [other "ALT_" overrides]
1538 </tt>
1539 </blockquote>
1540 </li>
1541 </ol>
1542 <p>
1543 <strong>Solaris:</strong>
1544 Note that ARCH_DATA_MODEL is really only needed on Solaris to
1545 indicate you want to built the 64-bit version.
1546 And before the Solaris 64-bit binaries can be used, they
1547 must be merged with the binaries from a separate 32-bit build.
1548 The merged binaries may then be used in either 32-bit or 64-bit mode, with
1549 the selection occurring at runtime
1550 with the <tt>-d32</tt> or <tt>-d64</tt> options.
1551 </blockquote>
1552 <!-- ------------------------------------------------------ -->
1553 <hr>
1554 <h2><a name="testing">Testing the Build</a></h2>
1555 <blockquote>
1556 When the build is completed, you should see the generated
1557 binaries and associated files in the <tt>j2sdk-image</tt>
1558 directory in the output directory.
1559 The default output directory is
1560 <tt>build/<i>platform</i></tt>,
1561 where <tt><i>platform</i></tt> is one of
1562 <blockquote>
1563 <ul>
1564 <li><tt>solaris-sparc</tt></li>
1565 <li><tt>solaris-sparcv9</tt></li>
1566 <li><tt>solaris-i586</tt></li>
1567 <li><tt>solaris-amd64</tt></li>
1568 <li><tt>linux-i586</tt></li>
1569 <li><tt>linux-amd64</tt></li>
1570 <li><tt>windows-i586</tt></li>
1571 <li><tt>windows-amd64</tt></li>
1572 </ul>
1573 </blockquote>
1574 In particular, the
1575 <tt>build/<i>platform</i>/j2sdk-image/bin</tt>
1576 directory should contain executables for the
1577 OpenJDK tools and utilities.
1578 <p>
1579 You can test that the build completed properly by using the build
1580 to run the various demos that you will find in the
1581 <tt>build/<i>platform</i>/j2sdk-image/demo</tt>
1582 directory.
1583 <p>
1584 The provided regression tests can be run with the <tt>jtreg</tt>
1585 utility from
1586 <a href="http://openjdk.java.net/jtreg/" target="_blank">the jtreg site</a>.
1587 </blockquote>
1588 <!-- ------------------------------------------------------ -->
1589 <hr>
1590 <h2><a name="variables">Environment/Make Variables</a></h2>
1591 <p>
1592 Some of the
1593 environment or make variables (just called <b>variables</b> in this
1594 document) that can impact the build are:
1595 <blockquote>
1596 <dl>
1597 <dt><a name="path"><tt>PATH</tt></a> </dt>
1598 <dd>Typically you want to set the <tt>PATH</tt> to include:
1599 <ul>
1600 <li>The location of the GNU make binary</li>
1601 <li>The location of the Bootstrap JDK <tt>java</tt>
1602 (see <a href="#bootjdk">Bootstrap JDK</a>)</li>
1603 <li>The location of the C/C++ compilers
1604 (see <a href="#compilers"><tt>compilers</tt></a>)</li>
1605 <li>The location or locations for the Unix command utilities
1606 (e.g. <tt>/usr/bin</tt>)</li>
1607 </ul>
1608 </dd>
1609 <dt><tt>MILESTONE</tt> </dt>
1610 <dd>
1611 The milestone name for the build (<i>e.g.</i>"beta").
1612 The default value is "internal".
1613 </dd>
1614 <dt><tt>BUILD_NUMBER</tt> </dt>
1615 <dd>
1616 The build number for the build (<i>e.g.</i> "b27").
1617 The default value is "b00".
1618 </dd>
1619 <dt><a name="arch_data_model"><tt>ARCH_DATA_MODEL</tt></a></dt>
1620 <dd>The <tt>ARCH_DATA_MODEL</tt> variable
1621 is used to specify whether the build is to generate 32-bit or 64-bit
1622 binaries.
1623 The Solaris build supports either 32-bit or 64-bit builds, but
1624 Windows and Linux will support only one, depending on the specific
1625 OS being used.
1626 Normally, setting this variable is only necessary on Solaris.
1627 Set <tt>ARCH_DATA_MODEL</tt> to <tt>32</tt> for generating 32-bit binaries,
1628 or to <tt>64</tt> for generating 64-bit binaries.
1629 </dd>
1630 <dt><a name="ALT_BOOTDIR"><tt>ALT_BOOTDIR</tt></a></dt>
1631 <dd>
1632 The location of the bootstrap JDK installation.
1633 See <a href="#bootjdk">Bootstrap JDK</a> for more information.
1634 You should always install your own local Bootstrap JDK and
1635 always set <tt>ALT_BOOTDIR</tt> explicitly.
1636 </dd>
1637 <dt><a name="ALT_JDK_IMPORT_PATH"><tt>ALT_JDK_IMPORT_PATH</tt></a></dt>
1638 <dd>
1639 The location of a previously built JDK installation.
1640 See <a href="#importjdk">Optional Import JDK</a> for more information.
1641 </dd>
1642 <dt><a name="ALT_OUTPUTDIR"><tt>ALT_OUTPUTDIR</tt></a> </dt>
1643 <dd>
1644 An override for specifying the (absolute) path of where the
1645 build output is to go.
1646 The default output directory will be build/<i>platform</i>.
1647 </dd>
1648 <dt><a name="ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> </dt>
1649 <dd>
1650 The location of the C/C++ compiler.
1651 The default varies depending on the platform.
1652 </dd>
1653 <dt><tt><a name="ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt></dt>
1654 <dd>
1655 The location of the <a href="#cacerts">cacerts</a> file.
1656 The default will refer to
1657 <tt>jdk/src/share/lib/security/cacerts</tt>.
1658 </dd>
1659 <dt><a name="ALT_CUPS_HEADERS_PATH"><tt>ALT_CUPS_HEADERS_PATH</tt></a> </dt>
1660 <dd>
1661 The location of the CUPS header files.
1662 See <a href="#cups">CUPS information</a> for more information.
1663 If this path does not exist the fallback path is
1664 <tt>/usr/include</tt>.
1665 </dd>
1666 <dt><a name="ALT_FREETYPE_LIB_PATH"><tt>ALT_FREETYPE_LIB_PATH</tt></a></dt>
1667 <dd>
1668 The location of the FreeType shared library.
1669 See <a href="#freetype">FreeType information</a> for details.
1670 </dd>
1671 <dt><a name="ALT_FREETYPE_HEADERS_PATH"><tt>ALT_FREETYPE_HEADERS_PATH</tt></a></dt>
1672 <dd>
1673 The location of the FreeType header files.
1674 See <a href="#freetype">FreeType information</a> for details.
1675 </dd>
1676 <dt><a name="ALT_JDK_DEVTOOLS_PATH"><tt>ALT_JDK_DEVTOOLS_PATH</tt></a></dt>
1677 <dd>
1678 The default root location of the devtools.
1679 The default value is
1680 <tt>$(ALT_SLASH_JAVA)/devtools</tt>.
1681 </dd>
1682 <dt><tt><a name="ALT_DEVTOOLS_PATH">ALT_DEVTOOLS_PATH</a></tt> </dt>
1683 <dd>
1684 The location of tools like the
1685 <a href="#zip"><tt>zip</tt> and <tt>unzip</tt></a>
1686 binaries, but might also contain the GNU make utility
1687 (<tt><i>gmake</i></tt>).
1688 So this area is a bit of a grab bag, especially on Windows.
1689 The default value depends on the platform and
1690 Unix Commands being used.
1691 On Linux the default will be
1692 <tt>$(ALT_JDK_DEVTOOLS_PATH)/linux/bin</tt>,
1693 on Solaris
1694 <tt>$(ALT_JDK_DEVTOOLS_PATH)/<i>{sparc,i386}</i>/bin</tt>,
1695 and on Windows with CYGWIN
1696 <tt>/usr/bin</tt>.
1697 </dd>
1698 <dt><tt><a name="ALT_DROPS_DIR">ALT_DROPS_DIR</a></tt> </dt>
1699 <dd>
1700 The location of any source drop bundles
1701 (see <a href="#drops">Managing the Source Drops</a>).
1702 The default will be
1703 <tt>$(ALT_JDK_DEVTOOLS_PATH)/share/jdk8-drops</tt>.
1704 </dd>
1705 <dt><a name="ALT_UNIXCCS_PATH"><tt>ALT_UNIXCCS_PATH</tt></a></dt>
1706 <dd>
1707 <strong>Solaris only:</strong>
1708 An override for specifying where the Unix CCS
1709 command set are located.
1710 The default location is <tt>/usr/ccs/bin</tt>
1711 </dd>
1712 <dt><a name="ALT_SLASH_JAVA"><tt>ALT_SLASH_JAVA</tt></a></dt>
1713 <dd>
1714 The default root location for many of the ALT path locations
1715 of the following ALT variables.
1716 The default value is
1717 <tt>"/java"</tt> on Solaris and Linux,
1718 <tt>"J:"</tt> on Windows.
1719 </dd>
1720 <dt><a name="ALT_BUILD_JDK_IMPORT_PATH"><tt>ALT_BUILD_JDK_IMPORT_PATH</tt></a></dt>
1721 <dd>
1722 These are useful in managing builds on multiple platforms.
1723 The default network location for all of the import JDK images
1724 for all platforms.
1725 If <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>
1726 is not set, this directory will be used and should contain
1727 the following directories:
1728 <tt>solaris-sparc</tt>,
1729 <tt>solaris-i586</tt>,
1730 <tt>solaris-sparcv9</tt>,
1731 <tt>solaris-amd64</tt>,
1732 <tt>linux-i586</tt>,
1733 <tt>linux-amd64</tt>,
1734 <tt>windows-i586</tt>,
1735 and
1736 <tt>windows-amd64</tt>.
1737 Where each of these directories contain the import JDK image
1738 for that platform.
1739 </dd>
1740 <dt><a name="ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a></dt>
1741 <dd>
1742 The top-level directory of the libraries and include files for the platform's
1743 graphical programming environment. The default location is platform specific.
1744 For example, on Linux it defaults to <tt>/usr/X11R6/</tt>.
1745 </dd>
1746 <dt><strong>Windows specific:</strong></dt>
1747 <dd>
1748 <dl>
1749 <dt><a name="ALT_WINDOWSSDKDIR"><tt>ALT_WINDOWSSDKDIR</tt></a> </dt>
1750 <dd>
1751 The location of the
1752 Microsoft Windows SDK where some tools will be
1753 located.
1754 The default is whatever WINDOWSSDKDIR is set to
1755 (or WindowsSdkDir) or the path
1756 <br>
1757 <tt>c:\Program Files\Microsoft SDKs\Windows\v7.0a</tt>
1758 </dd>
1759 <dt><tt><a name="ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt> </dt>
1760 <dd>
1761 The location of the
1762 <a href="#dxsdk">Microsoft DirectX 9 SDK</a>.
1763 The default will be to try and use the DirectX environment
1764 variable <tt>DXSDK_DIR</tt>,
1765 failing that, look in <tt>C:/DXSDK</tt>.
1766 </dd>
1767 <dt><tt><a name="ALT_MSVCRNN_DLL_PATH">ALT_MSVCRNN_DLL_PATH</a></tt> </dt>
1768 <dd>
1769 The location of the
1770 <a href="#msvcrNN"><tt>MSVCR100.DLL</tt></a>.
1771 </dd>
1772 </dl>
1773 </dd>
1774 <dt><strong>Cross-Compilation Support:</strong></dt>
1775 <dd>
1776 <dl>
1777 <dt><a name="CROSS_COMPILE_ARCH"><tt>CROSS_COMPILE_ARCH</tt></a> </dt>
1778 <dd>
1779 Set to the target architecture of a cross-compilation build. If set, this
1780 variable is used to signify that we are cross-compiling. The expectation
1781 is that <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> is set
1782 to point to the cross-compiler and that any cross-compilation specific flags
1783 are passed using <a href="#EXTRA_CFLAGS"><tt>EXTRA_CFLAGS</tt></a>.
1784 The <a href="#ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a> variable should
1785 also be set to point to the graphical header files (e.g. X11) provided with
1786 the cross-compiler.
1787 When cross-compiling we skip execution of any demos etc that may be built, and
1788 also skip binary-file verification.
1789 </dd>
1790 <dt><tt><a name="EXTRA_CFLAGS">EXTRA_CFLAGS</a></tt> </dt>
1791 <dd>
1792 Used to pass cross-compilation options to the cross-compiler.
1793 These are added to the <tt>CFLAGS</tt> and <tt>CXXFLAGS</tt> variables.
1794 </dd>
1795 <dt><tt><a name="USE_ONLY_BOOTDIR_TOOLS">USE_ONLY_BOOTDIR_TOOLS</a></tt> </dt>
1796 <dd>
1797 Used primarily for cross-compilation builds (and always set in that case)
1798 this variable indicates that tools from the boot JDK should be used during
1799 the build process, not the tools (<tt>javac</tt>, <tt>javah</tt>, <tt>jar</tt>)
1800 just built (which can't execute on the build host).
1801 </dd>
1802 <dt><tt><a name="HOST_CC">HOST_CC</a></tt> </dt>
1803 <dd>
1804 The location of the C compiler to generate programs to run on the build host.
1805 Some parts of the build generate programs that are then compiled and executed
1806 to produce other parts of the build. Normally the primary C compiler is used
1807 to do this, but when cross-compiling that would be the cross-compiler and the
1808 resulting program could not be executed.
1809 On Linux this defaults to <tt>/usr/bin/gcc</tt>; on other platforms it must be
1810 set explicitly.
1811 </dd>
1812 </dl>
1813 <dt><strong>Specialized Build Options:</strong></dt>
1814 <dd>
1815 Some build variables exist to support specialized build environments and/or specialized
1816 build products. Their use is only supported in those contexts:
1817 <dl>
1818 <dt><tt><a name="BUILD_CLIENT_ONLY">BUILD_CLIENT_ONLY</a></tt> </dt>
1819 <dd>
1820 Indicates this build will only contain the Hotspot client VM. In addition to
1821 controlling the Hotspot build target, it ensures that we don't try to copy
1822 any server VM files/directories, and defines a default <tt>jvm.cfg</tt> file
1823 suitable for a client-only environment. Using this in a 64-bit build will
1824 generate a sanity warning as 64-bit client builds are not directly supported.
1825 </dd>
1826 <dt><tt><a name="BUILD_HEADLESS_ONLY"></a>BUILD_HEADLESS_ONLY</tt> </dt>
1827 <dd>
1828 Used when the build environment has no graphical capabilities at all. This
1829 excludes building anything that requires graphical libraries to be available.
1830 </dd>
1831 <dt><tt><a name="JAVASE_EMBEDDED"></a>JAVASE_EMBEDDED</tt> </dt>
1832 <dd>
1833 Used to indicate this is a build of the Oracle Java SE Embedded product.
1834 This will enable the directives included in the SE-Embedded specific build
1835 files.
1836 </dd>
1837 <dt><tt><a name="LIBZIP_CAN_USE_MMAP">LIBZIP_CAN_USE_MMAP</a></tt> </dt>
1838 <dd>
1839 If set to false, disables the use of mmap by the zip utility. Otherwise,
1840 mmap will be used.
1841 </dd>
1842 <dt><tt><a name="COMPRESS_JARS"></a>COMPRESS_JARS</tt> </dt>
1843 <dd>
1844 If set to true, causes certain jar files that would otherwise be built without
1845 compression, to use compression.
1846 </dd>
1847 </dl>
1848 </dd>
1849 </dl>
1850 </blockquote>
1851 <!-- ------------------------------------------------------ -->
1852 <hr>
1853 <h2><a name="hints">Hints and Tips</a></h2>
1854 <blockquote>
1855 You don't have to use all these hints and tips, and in fact people do actually
1856 build with systems that contradict these, but they might prove to be
1857 helpful to some.
1858 <ul>
1859 <li>
1860 If <tt>make sanity</tt> does not work, find out why, fix that
1861 before going any further. Or at least understand what the
1862 complaints are from it.
1863 </li>
1864 <li>
1865 JDK: Keep in mind that you are building a JDK, but you need
1866 a JDK (BOOTDIR JDK) to build this JDK.
1867 </li>
1868 <li>
1869 Ant: The ant utility is a java application and besides having
1870 ant available to you, it's important that ant finds the right
1871 java to run with. Make sure you can type <tt>ant -version</tt>
1872 and get clean results with no error messages.
1873 </li>
1874 <li>
1875 Linux: Try and favor the system packages over building your own
1876 or getting packages from other areas.
1877 Most Linux builds should be possible with the system's
1878 available packages.
1879 </li>
1880 <li>
1881 Solaris: Typically you will need to get compilers on your systems
1882 and occasionally GNU make 3.81 if a gmake binary is not available.
1883 The gmake binary might not be 3.81, be careful.
1884 </li>
1885 <li>
1886 Windows VS2010:
1887 <ul>
1888 <li>
1889 Only the C++ part of VS2010 is needed.
1890 Try to let the installation go to the default install directory.
1891 Always reboot your system after installing VS2010.
1892 The system environment variable VS100COMNTOOLS should be
1893 set in your environment.
1894 </li>
1895 <li>
1896 Make sure that TMP and TEMP are also set in the environment
1897 and refer to Windows paths that exist, like <tt>C:\temp</tt>,
1898 not <tt>/tmp</tt>, not <tt>/cygdrive/c/temp</tt>, and not <tt>C:/temp</tt>.
1899 <tt>C:\temp</tt> is just an example, it is assumed that this area is
1900 private to the user, so by default after installs you should
1901 see a unique user path in these variables.
1902 </li>
1903 <li>
1904 You need to use vsvars32.bat or vsvars64.bat to get the
1905 PATH, INCLUDE, LIB, LIBPATH, and WINDOWSSDKDIR
1906 variables set in your shell environment.
1907 These bat files are not easy to use from a shell environment.
1908 However, there is a script placed in the root jdk8 repository called
1909 vsvars.sh that can help, it should only be done once in a shell
1910 that will be doing the build, e.g.<br>
1911 <tt>sh ./make/scripts/vsvars.sh -v10 > settings<br>
1912 eval `cat settings`</tt><br>
1913 Or just <tt>eval `sh ./make/scripts/vsvars.sh -v10`</tt>.
1914 </li>
1915 </ul>
1916 </li>
1917 <li>
1918 Windows: PATH order is critical, see the
1919 <a href="#paths">paths</a> section for more information.
1920 </li>
1921 <li>
1922 Windows 64bit builds: Use ARCH_DATA_MODEL=64.
1923 </li>
1924 </ul>
1925 </blockquote>
1926 <!-- ------------------------------------------------------ -->
1927 <hr>
1928 <h2><a name="troubleshooting">Troubleshooting</a></h2>
1929 <blockquote>
1930 A build can fail for any number of reasons.
1931 Most failures
1932 are a result of trying to build in an environment in which all the
1933 pre-build requirements have not been met.
1934 The first step in
1935 troubleshooting a build failure is to recheck that you have satisfied
1936 all the pre-build requirements for your platform.
1937 Look for the check list of the platform you are building on in the
1938 <a href="#contents">Table of Contents</a>.
1939 <p>
1940 You can validate your build environment by using the <tt>sanity</tt>
1941 target.
1942 Any errors listed
1943 will stop the build from starting, and any warnings may result in
1944 a flawed product build.
1945 We strongly encourage you to evaluate every
1946 sanity check warning and fix it if required, before you proceed
1947 further with your build.
1948 <p>
1949 Some of the more common problems with builds are briefly described
1950 below, with suggestions for remedies.
1951 <ul>
1952 <li>
1953 <b>Corrupted Bundles on Windows:</b>
1954 <blockquote>
1955 Some virus scanning software has been known to corrupt the
1956 downloading of zip bundles.
1957 It may be necessary to disable the 'on access' or 'real time'
1958 virus scanning features to prevent this corruption.
1959 This type of "real time" virus scanning can also slow down the
1960 build process significantly.
1961 Temporarily disabling the feature, or excluding the build
1962 output directory may be necessary to get correct and faster builds.
1963 </blockquote>
1964 </li>
1965 <li>
1966 <b>Slow Builds:</b>
1967 <blockquote>
1968 If your build machine seems to be overloaded from too many
1969 simultaneous C++ compiles, try setting the <tt>HOTSPOT_BUILD_JOBS</tt>
1970 variable to <tt>1</tt> (if you're using a multiple CPU
1971 machine, setting it to more than the the number of CPUs is probably
1972 not a good idea).
1973 <p>
1974 Creating the javadocs can be very slow, if you are running
1975 javadoc, consider skipping that step.
1976 <p>
1977 Faster hardware and more RAM always helps too.
1978 The VM build tends to be CPU intensive (many C++ compiles),
1979 and the rest of the JDK will often be disk intensive.
1980 <p>
1981 Faster compiles are possible using a tool called
1982 <a href="http://ccache.samba.org/" target="_blank">ccache</a>.
1983 </blockquote>
1984 </li>
1985 <li>
1986 <b>File time issues:</b>
1987 <blockquote>
1988 If you see warnings that refer to file time stamps, e.g.
1989 <blockquote>
1990 <i>Warning message:</i><tt> File `xxx' has modification time in
1991 the future.</tt>
1992 <br>
1993 <i>Warning message:</i> <tt> Clock skew detected. Your build may
1994 be incomplete.</tt>
1995 </blockquote>
1996 These warnings can occur when the clock on the build machine is out of
1997 sync with the timestamps on the source files. Other errors, apparently
1998 unrelated but in fact caused by the clock skew, can occur along with
1999 the clock skew warnings. These secondary errors may tend to obscure the
2000 fact that the true root cause of the problem is an out-of-sync clock.
2001 For example, an out-of-sync clock has been known to cause an old
2002 version of javac to be used to compile some files, resulting in errors
2003 when the pre-1.4 compiler ran across the new <tt>assert</tt> keyword
2004 in the 1.4 source code.
2005 <p>
2006 If you see these warnings, reset the clock on the build
2007 machine, run "<tt><i>gmake</i> clobber</tt>" or delete the directory
2008 containing the build output, and restart the build from the beginning.
2009 </blockquote>
2010 </li>
2011 <li>
2012 <b>Error message: <tt>Trouble writing out table to disk</tt></b>
2013 <blockquote>
2014 Increase the amount of swap space on your build machine.
2015 </blockquote>
2016 </li>
2017 <li>
2018 <b>Error Message: <tt>libstdc++ not found:</tt></b>
2019 <blockquote>
2020 This is caused by a missing libstdc++.a library.
2021 This is installed as part of a specific package
2022 (e.g. libstdc++.so.devel.386).
2023 By default some 64-bit Linux versions (e.g. Fedora)
2024 only install the 64-bit version of the libstdc++ package.
2025 Various parts of the JDK build require a static
2026 link of the C++ runtime libraries to allow for maximum
2027 portability of the built images.
2028 </blockquote>
2029 </li>
2030 <li>
2031 <b>Error Message: <tt>cannot restore segment prot after reloc</tt></b>
2032 <blockquote>
2033 This is probably an issue with SELinux (See
2034 <a href="http://en.wikipedia.org/wiki/SELinux" target="_blank">
2035 http://en.wikipedia.org/wiki/SELinux</a>).
2036 Parts of the VM is built without the <tt>-fPIC</tt> for
2037 performance reasons.
2038 <p>
2039 To completely disable SELinux:
2040 <ol>
2041 <li><tt>$ su root</tt></li>
2042 <li><tt># system-config-securitylevel</tt></li>
2043 <li><tt>In the window that appears, select the SELinux tab</tt></li>
2044 <li><tt>Disable SELinux</tt></li>
2045 </ol>
2046 <p>
2047 Alternatively, instead of completely disabling it you could
2048 disable just this one check.
2049 <ol>
2050 <li>Select System->Administration->SELinux Management</li>
2051 <li>In the SELinux Management Tool which appears,
2052 select "Boolean" from the menu on the left</li>
2053 <li>Expand the "Memory Protection" group</li>
2054 <li>Check the first item, labeled
2055 "Allow all unconfined executables to use libraries requiring text relocation ..."</li>
2056 </ol>
2057 </blockquote>
2058 </li>
2059 <li>
2060 <b>Windows Error Messages:</b><br>
2061 <tt>*** fatal error - couldn't allocate heap, ... </tt><br>
2062 <tt>rm fails with "Directory not empty"</tt><br>
2063 <tt>unzip fails with "cannot create ... Permission denied"</tt><br>
2064 <tt>unzip fails with "cannot create ... Error 50"</tt><br>
2065 <blockquote>
2066 The CYGWIN software can conflict with other non-CYGWIN
2067 software. See the CYGWIN FAQ section on
2068 <a href="http://cygwin.com/faq/faq.using.html#faq.using.bloda" target="_blank">
2069 BLODA (applications that interfere with CYGWIN)</a>.
2070 </blockquote>
2071 </li>
2072 <li>
2073 <b>Windows Error Message: <tt>spawn failed</tt></b>
2074 <blockquote>
2075 Try rebooting the system, or there could be some kind of
2076 issue with the disk or disk partition being used.
2077 Sometimes it comes with a "Permission Denied" message.
2078 </blockquote>
2079 </li>
2080 </ul>
2081 </blockquote>
2082 <hr>
2083 </body>
2084 </html>