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