duke@2: duke@2: ohair@13: ohair@13: OpenJDK Build README ohair@13: ohair@13: ohair@13: ohair@41: ohair@13: ohair@13: ohair@13: ohair@13: ohair@13: ohair@13: ohair@13:
ohair@25: OpenJDK ohair@13:
ohair@13:

OpenJDK Build README

ohair@13:
ohair@13: ohair@13:
ohair@13:

Introduction

ohair@13:
ohair@13:

ohair@276: This README file contains build instructions for the ohair@276: OpenJDK. ohair@276: Building the source code for the ohair@276: OpenJDK ohair@276: requires ohair@276: a certain degree of technical expertise. ohair@13:

ohair@13: ohair@13:
ohair@13:

Contents

ohair@13:
ohair@13: ohair@13:
ohair@276: ohair@276: ohair@276:
ohair@276:

Use of Mercurial

ohair@276:
ohair@276: The OpenJDK sources are maintained with the revision control system ohair@276: Mercurial. ohair@276: If you are new to Mercurial, please see the ohair@276: Beginner Guides ohair@320: or refer to the Mercurial Book. ohair@276: The first few chapters of the book provide an excellent overview of ohair@276: Mercurial, what it is and how it works. ohair@276:
ohair@276: For using Mercurial with the OpenJDK refer to the ohair@320: ohair@320: Developer Guide: Installing and Configuring Mercurial ohair@276: section for more information. ohair@276: The Forest Extension is not part of the Mercurial install, ohair@276: and is optional, ohair@276: but can be obtained with the following commands: ohair@276:
ohair@276: ohair@276: hg clone https://bitbucket.org/pmezard/hgforest-crew/overview/ YourHgForest ohair@276: ohair@276:
ohair@276: Once you have the file forest.py, you need to add these ohair@276: lines to your ${HOME}/.hgrc file: ohair@276:
ohair@276: ohair@276: [extensions] ohair@276:
forest = YourHgForest/forest.py ohair@276:
ohair@276:
ohair@276: ohair@276: ohair@276:

Getting the Source

ohair@276:
ohair@276: To get the entire set of OpenJDK Mercurial repositories ohair@276: using the Forest Extension: ohair@276:
ohair@276: ohair@320: hg fclone http://hg.openjdk.java.net/jdk7/jdk7 YourOpenJDK ohair@276: ohair@276:
ohair@276: To get the entire set of OpenJDK Mercurial repositories ohair@276: without using the Forest Extension: ohair@276:
ohair@276: ohair@320: hg clone http://hg.openjdk.java.net/jdk7/jdk7 YourOpenJDK ohair@276:
cd YourOpenJDK ohair@276:
sh ./get_source.sh ohair@276:
ohair@276:
ohair@276: Once you have all the repositories, the ohair@276: script make/scripts/hgforest.sh ohair@276: can be used to repeat the same hg ohair@276: command on every repository in the forest, e.g. ohair@276:
ohair@276: ohair@276: cd YourOpenJDK ohair@276:
sh ./make/scripts/hgforest.sh pull -u ohair@276:
ohair@276:
ohair@276: You may find this script make/scripts/hgforest.sh faster ohair@276: than the hg forest commands provided by the ohair@276: Forest Extension. ohair@276:
ohair@276: ohair@276:
ohair@276: ohair@13: ohair@13:
ohair@13:

Minimum Build Environments

ohair@13:
ohair@13: This file often describes specific requirements for what we call the ohair@49: "minimum build environments" (MBE) for this ohair@49: specific release of the JDK, ohair@13: Building with the MBE will generate the most compatible ohair@13: bits that install on, and run correctly on, the most variations ohair@13: of the same base OS and hardware architecture. ohair@13: These usually represent what is often called the ohair@13: least common denominator platforms. ohair@13: It is understood that most developers will NOT be using these ohair@13: specific platforms, and in fact creating these specific platforms ohair@13: may be difficult due to the age of some of this software. ohair@13:

ohair@276: The minimum OS and C/C++ compiler versions needed for building the ohair@276: OpenJDK: ohair@13:

ohair@13: ohair@13: ohair@13: ohair@13: ohair@13: ohair@49: xdono@105: ohair@13: ohair@13: ohair@13: ohair@13: ohair@49: ohair@49: ohair@320: ohair@320: ohair@13: ohair@13: ohair@49: ohair@49: ohair@320: ohair@320: ohair@13: ohair@13: ohair@49: ohair@320: ohair@211: ohair@320: ohair@13: ohair@13: ohair@49: ohair@320: ohair@211: ohair@320: ohair@13: ohair@13: ohair@49: ohair@320: ohair@211: ohair@320: ohair@13: ohair@13: ohair@49: ohair@320: ohair@211: ohair@320: ohair@13: ohair@13: ohair@49: ohair@13: prr@175: ohair@320: ohair@13: ohair@13: ohair@49: ohair@13: prr@175: ohair@320: ohair@13: ohair@13: ohair@13:
Base OS and ArchitectureOSC/C++ CompilerBOOT JDK
Linux X86 (32-bit)Fedora 9gcc 4.3 JDK 6u18
Linux X64 (64-bit)Fedora 9gcc 4.3 JDK 6u18
Solaris SPARC (32-bit)Solaris 10 Update 6Sun Studio 12 Update 1 + patchesJDK 6u18
Solaris SPARCV9 (64-bit)Solaris 10 Update 6Sun Studio 12 Update 1 + patchesJDK 6u18
Solaris X86 (32-bit)Solaris 10 Update 6Sun Studio 12 Update 1 + patchesJDK 6u18
Solaris X64 (64-bit)Solaris 10 Update 6Sun Studio 12 Update 1 + patchesJDK 6u18
Windows X86 (32-bit)Windows XPMicrosoft Visual Studio C++ 2010 Professional EditionJDK 6u18
Windows X64 (64-bit)Windows Server 2003 - Enterprise x64 EditionMicrosoft Visual Studio C++ 2010 Professional EditionJDK 6u18
ohair@276:

ohair@49: These same sources do indeed build on many more systems than the ohair@49: above older generation systems, again the above is just a minimum. ohair@276:

ohair@49: Compilation problems with newer or different C/C++ compilers is a ohair@49: common problem. ohair@49: Similarly, compilation problems related to changes to the ohair@276: /usr/include or system header files is also a ohair@49: common problem with newer or unreleased OS versions. ohair@49: Please report these types of problems as bugs so that they ohair@49: can be dealt with accordingly. ohair@13:

ohair@13: ohair@13:
ohair@13:

Specific Developer Build Environments

ohair@13:
ohair@13: We won't be listing all the possible environments, but ohair@13: we will try to provide what information we have available to us. ohair@13:
ohair@13: robilad@132:

Fedora

ohair@13:
ohair@276:

Fedora 9

ohair@276:

ohair@276:

ohair@276: After installing Fedora 9 robilad@132: you need to install several build dependencies. The simplest robilad@132: way to do it is to execute the following commands as user ohair@276: root: ohair@276:

ohair@320: yum-builddep java-1.6.0-openjdk ohair@276:

ohair@276: yum install gcc gcc-c++ ohair@276:

robilad@132: In addition, it's necessary to set a few environment variables for the build: robilad@132: ohair@276:

ohair@276: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk ohair@41:

ohair@276:

Fedora 10

ohair@276:

ohair@276:

ohair@276: After installing Fedora 10 robilad@132: you need to install several build dependencies. The simplest robilad@132: way to do it is to execute the following commands as user ohair@276: root: ohair@276:

ohair@276: yum-builddep java-1.6.0-openjdk ohair@276:

ohair@276: yum install gcc gcc-c++ ohair@276:

robilad@132: In addition, it's necessary to set a few environment variables for the build: robilad@132: ohair@276:

ohair@276: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk robilad@132:

ohair@276:

Fedora 11

ohair@276:

ohair@276:

ohair@276: After installing Fedora 11 robilad@132: you need to install several build dependencies. The simplest robilad@132: way to do it is to execute the following commands as user ohair@276: root: ohair@276:

ohair@276: yum-builddep java-1.6.0-openjdk ohair@276:

ohair@276: yum install gcc gcc-c++ ohair@276:

robilad@132: In addition, it's necessary to set a few environment variables for the build: robilad@132: ohair@276:

ohair@276: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk ohair@276:

ohair@13:
ohair@13: ohair@320:

CentOS 5.5

ohair@13:
ohair@41: After installing ohair@320: CentOS 5.5 ohair@41: you need to make sure you have ohair@41: the following Development bundles installed: ohair@41:
ohair@41: ohair@41:
ohair@41:

ohair@276: Plus the following packages: ohair@41:

ohair@41: ohair@41:
ohair@41:

ohair@276: The freetype 2.3 packages don't seem to be available, ohair@276: but the freetype 2.3 sources can be downloaded, built, ohair@276: and installed easily enough from ohair@276: ohair@276: the freetype site. ohair@276: Build and install with something like: ohair@41:

ohair@41: ./configure && make && sudo -u root make install ohair@41:
ohair@41:

ohair@276: Mercurial packages could not be found easily, but a Google ohair@276: search should find ones, and they usually include Python if ohair@276: it's needed. ohair@13:

ohair@13: robilad@132:

Debian

ohair@13:
robilad@132:

Debian 5.0 (Lenny)

ohair@13:

ohair@276:

robilad@132: After installing Debian 5 robilad@132: you need to install several build dependencies. robilad@132: The simplest way to install the build dependencies is to robilad@132: execute the following commands as user root: ohair@276:

ohair@276: aptitude build-dep openjdk-6 ohair@276:

ohair@276: aptitude install openjdk-6-jdk libmotif-dev ohair@276:

robilad@132: In addition, it's necessary to set a few environment variables for the build: ohair@276:

ohair@276: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk ohair@276:

robilad@132:
robilad@132: ohair@276:

Ubuntu

robilad@132:
robilad@132:

Ubuntu 8.04

ohair@13:

ohair@276:

robilad@132: After installing Ubuntu 8.04 robilad@132: you need to install several build dependencies. ohair@276:

robilad@132: First, you need to enable the universe repository in the robilad@132: Software Sources application and reload the repository robilad@132: information. The Software Sources application is available robilad@132: under the System/Administration menu. ohair@276:

robilad@132: The simplest way to install the build dependencies is to robilad@132: execute the following commands: ohair@276:

ohair@276: sudo aptitude build-dep openjdk-6 ohair@276:

ohair@276: sudo aptitude install openjdk-6-jdk ohair@276:

robilad@132: In addition, it's necessary to set a few environment variables for the build: ohair@276:

ohair@276: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk ohair@276:

ohair@276:

Ubuntu 8.10

ohair@13:

ohair@276:

robilad@132: After installing Ubuntu 8.10 robilad@132: you need to install several build dependencies. The simplest robilad@132: way to do it is to execute the following commands: ohair@276:

ohair@276: sudo aptitude build-dep openjdk-6 ohair@276:

ohair@276: sudo aptitude install openjdk-6-jdk ohair@276:

robilad@132: In addition, it's necessary to set a few environment variables for the build: ohair@276:

ohair@276: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk ohair@276:

ohair@276:

Ubuntu 9.04

ohair@13:

ohair@276:

robilad@132: After installing Ubuntu 9.04 robilad@132: you need to install several build dependencies. The simplest robilad@132: way to do it is to execute the following commands: ohair@276:

ohair@276: sudo aptitude build-dep openjdk-6 ohair@276:

ohair@276: sudo aptitude install openjdk-6-jdk ohair@276:

robilad@132: In addition, it's necessary to set a few environment variables for the build: ohair@276:

ohair@276: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk ohair@276:

ohair@13:
robilad@132: robilad@132:

OpenSUSE

robilad@132:
robilad@132:

OpenSUSE 11.1

robilad@132:

ohair@276:

robilad@132: After installing OpenSUSE 11.1 robilad@132: you need to install several build dependencies. robilad@132: The simplest way to install the build dependencies is to robilad@132: execute the following commands: ohair@276:

ohair@276: sudo zypper source-install -d java-1_6_0-openjdk ohair@276:

ohair@276: sudo zypper install make ohair@276:

robilad@132: In addition, it is necessary to set a few environment variables for the build: ohair@276:

ohair@276: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk ohair@276:

robilad@132: Finally, you need to unset the JAVA_HOME environment variable: ohair@276:

ohair@276: export -n JAVA_HOME ohair@276:

ohair@276:
robilad@132: robilad@132:

Mandriva

robilad@132:
robilad@132:

Mandriva Linux One 2009 Spring

robilad@132:

ohair@276:

robilad@132: After installing Mandriva Linux One 2009 Spring robilad@132: you need to install several build dependencies. robilad@132: The simplest way to install the build dependencies is to robilad@132: execute the following commands as user root: ohair@276:

ohair@276: 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 robilad@132:

robilad@132: In addition, it is necessary to set a few environment variables for the build: ohair@276:

ohair@276: export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk ohair@276:

robilad@132:
robilad@132: robilad@132:

OpenSolaris

robilad@132:
robilad@132:

OpenSolaris 2009.06

robilad@132:

ohair@276:

robilad@132: After installing OpenSolaris 2009.06 robilad@132: you need to install several build dependencies. robilad@132: The simplest way to install the build dependencies is to robilad@132: execute the following commands: ohair@276:

ohair@276: pfexec pkg install SUNWgmake SUNWj6dev SUNWant sunstudioexpress SUNWcups SUNWzip SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2 robilad@132:

robilad@132: In addition, it is necessary to set a few environment variables for the build: ohair@276:

ohair@276: export LANG=C ALT_COMPILER_PATH=/opt/SunStudioExpress/bin/ ALT_CUPS_HEADERS_PATH=/usr/include/ ohair@276:

robilad@132: Finally, you need to make sure that the build process can find the Sun Studio compilers: ohair@276:

ohair@276: export PATH=$PATH:/opt/SunStudioExpress/bin/ ohair@276:

robilad@132:
robilad@132: ohair@13:
ohair@13:

Source Directory Structure

ohair@13:
ohair@13:

ohair@276: The source code for the OpenJDK is delivered in a set of ohair@276: directories: ohair@276: hotspot, ohair@276: langtools, ohair@276: corba, ohair@276: jaxws, ohair@276: jaxp, ohair@276: and ohair@276: jdk. ohair@276: The hotspot directory contains the source code and make ohair@276: files for building the OpenJDK Hotspot Virtual Machine. ohair@276: The langtools directory contains the source code and make ohair@276: files for building the OpenJDK javac and language tools. ohair@276: The corba directory contains the source code and make ohair@276: files for building the OpenJDK Corba files. ohair@276: The jaxws directory contains the source code and make ohair@276: files for building the OpenJDK JAXWS files. ohair@276: The jaxp directory contains the source code and make ohair@276: files for building the OpenJDK JAXP files. ohair@276: The jdk directory contains the source code and make files for ohair@276: building the OpenJDK runtime libraries and misc files. ohair@276: The top level Makefile ohair@276: is used to build the entire OpenJDK. ohair@320: ohair@320:

Managing the Source Drops

ohair@320:
ohair@320:

ohair@320: The repositories jaxp and jaxws actually ohair@320: do not contain the sources for JAXP or JAX-WS. ohair@320: These products have their own open source procedures at their ohair@320: JAXP and ohair@320: JAX-WS home pages. ohair@320: The OpenJDK project does need access to these sources to build ohair@320: a complete JDK image because JAXP and JAX-WS are part of the JDK. ohair@320: The current process for delivery of the JAXP and JAX-WS sources ohair@320: involves so called "source drop bundles" downloaded from a public ohair@320: website. ohair@320: There are many reasons for this current mechanism, and it is ohair@320: understood that this is not ideal for the open source community. ohair@320: It is possible this process could change in the future. ohair@320:
ohair@320: NOTE: The ohair@320: Complete OpenJDK Source Bundles will contain the JAXP and ohair@320: JAX-WS sources. ohair@320:

ohair@320: ohair@320:

Creation of New Source Drop Bundles

ohair@320:
ohair@320:
    ohair@320:
  1. ohair@320: The JAXP or JAX-WS team prepares a new zip bundle, ohair@320: places a copy in a public download area on java.net, ohair@320: sends us a link and a list of CRs (Change Request Numbers). ohair@320: The older download bundles should not be deleted. ohair@320: It is the responsibility of the JAXP and JAX-WS team to ohair@320: place the proper GPL legal notices on the sources ohair@320: and do any filtering or java re-packaging for the ohair@320: OpenJDK instances of these classes. ohair@320:
  2. ohair@320:
  3. ohair@320: The OpenJDK team copies this new bundle into shared ohair@320: area (e.g. /java/devtools/share/jdk7-drops). ohair@320: Older bundles are never deleted so we retain the history. ohair@320:
  4. ohair@320:
  5. ohair@320: The OpenJDK team edits the ant property file ohair@320: jaxp/jaxp.properties or ohair@320: jaxws/jaxws.properties to update the ohair@320: base URL, the zip bundle name, and the MD5 checksum ohair@320: of the zip bundle ohair@320: (on Solaris: sum -c md5 bundlename) ohair@320:
  6. ohair@320:
  7. ohair@320: OpenJDK team reviews and commits those changes with the ohair@320: given CRs. ohair@320:
  8. ohair@320:
ohair@320:
ohair@320: ohair@320:

Using Source Drop Bundles

ohair@320:
ohair@320:

ohair@320: The ant scripts that build jaxp and jaxws ohair@320: will attempt to locate these zip bundles from the directory ohair@320: in the environment variable ohair@320: ALT_DROPS_DIR. ohair@320: The checksums protect from getting the wrong, corrupted, or ohair@320: improperly modified sources. ohair@320: Once the sources are made available, the population will not ohair@320: happen again unless a make clobber is requested ohair@320: or the jaxp/drop/ or jaxws/drop/ ohair@320: directory is explicitly deleted. ohair@320:
ohair@320: NOTE: The default Makefile and ant script behavior ohair@320: is to NOT download these bundles from the public http site. ohair@320: In general, doing downloads ohair@320: during the build process is not advised, it creates too much ohair@320: unpredictability in the build process. ohair@320: However, you can use make ALLOW_DOWNLOADS=true to ohair@320: tell the ant script that the download of the zip bundle is ohair@320: acceptable. ohair@320:

ohair@320:

ohair@320: The recommended procedure for keeping a cache of these ohair@320: source bundles would be to download them once, place them ohair@320: in a directory outside the repositories, and then set ohair@320: ALT_DROPS_DIR to refer ohair@320: to that directory. ohair@320: These drop bundles do change occasionally, so the newer ohair@320: bundles may need to be added to this area from time to time. ohair@320:

ohair@320:
ohair@320:
ohair@13:
ohair@13: ohair@13:
ohair@13:

Build Information

ohair@13:
ohair@13: Building the OpenJDK ohair@320: is done with a GNU make command line ohair@320: and various ohair@320: environment or make variable settings that direct the makefile rules ohair@13: to where various components have been installed. ohair@13: Where possible the makefiles will attempt to located the various ohair@13: components in the default locations or any component specific ohair@13: variable settings. ohair@13: When the normal defaults fail or components cannot be found, ohair@13: the various ohair@13: ALT_* variables (alternates) ohair@13: can be used to help the makefiles locate components. ohair@13:

ohair@276: Refer to the bash/sh/ksh setup file ohair@276: jdk/make/jdk_generic_profile.sh ohair@276: if you need help in setting up your environment variables. ohair@276: A build could be as simple as: ohair@13:

ohair@13:

duke@2:                 bash
duke@2:                 . jdk/make/jdk_generic_profile.sh
ohair@320:                 make sanity && make
ohair@13:                 
ohair@13:
ohair@13:

ohair@276: Of course ksh or sh would work too. ohair@276: But some customization will probably be necessary. ohair@276: The sanity rule will make some basic checks on build ohair@276: dependencies and generate appropriate warning messages ohair@276: regarding missing, out of date, or newer than expected components ohair@276: found on your system. ohair@13:

ohair@13: ohair@13:
ohair@13:

GNU make (gmake)

ohair@13:
ohair@13: The Makefiles in the OpenJDK are only valid when used with the ohair@13: GNU version of the utility command make ohair@13: (gmake). ohair@13: A few notes about using GNU make: ohair@13: ohair@13:

ohair@276: Information on GNU make, and access to ftp download sites, are ohair@276: available on the ohair@276: ohair@276: GNU make web site ohair@276: . ohair@276: The latest source to GNU make is available at ohair@276: ohair@276: ftp.gnu.org/pub/gnu/make/. ohair@320:

ohair@320: ohair@320:

Building GNU make

ohair@320:
ohair@320: First step is to get the GNU make 3.81 source from ohair@320: ohair@320: ftp.gnu.org/pub/gnu/make/. ohair@320: Building is a little different depending on the OS and unix toolset ohair@320: on Windows: ohair@320: ohair@320:
ohair@13:
ohair@13: ohair@13:
ohair@13:

Basic Linux System Setup

ohair@13:
ohair@13: i586 only: ohair@13: The minimum recommended hardware for building the Linux version ohair@13: is a Pentium class processor or better, at least 256 MB of RAM, and ohair@13: approximately 1.5 GB of free disk space. ohair@13:

ohair@276: X64 only: ohair@276: The minimum recommended hardware for building the Linux ohair@276: version is an AMD Opteron class processor, at least 512 MB of RAM, and ohair@276: approximately 4 GB of free disk space. ohair@13:

ohair@276: The build will use the tools contained in ohair@276: /bin and ohair@276: /usr/bin ohair@276: of a standard installation of the Linux operating environment. ohair@276: You should ensure that these directories are in your ohair@276: PATH. ohair@13:

ohair@276: Note that some Linux systems have a habit of pre-populating ohair@276: your environment variables for you, for example JAVA_HOME ohair@276: might get pre-defined for you to refer to the JDK installed on ohair@276: your Linux system. ohair@276: You will need to unset JAVA_HOME. ohair@276: It's a good idea to run env and verify the ohair@276: environment variables you are getting from the default system ohair@276: settings make sense for building the ohair@276: OpenJDK. ohair@13:

ohair@13: ohair@13:

Basic Linux Check List

ohair@13:
ohair@13:
    ohair@13:
  1. ohair@13: Install the ohair@13: Bootstrap JDK, set ohair@13: ALT_BOOTDIR. ohair@13:
  2. ohair@13:
  3. ohair@13: Optional Import JDK, set ohair@13: ALT_JDK_IMPORT_PATH. ohair@13:
  4. ohair@13:
  5. ohair@13: Install or upgrade the FreeType development ohair@276: package. ohair@13:
  6. ohair@25:
  7. ohair@25: Install ohair@320: Ant 1.7.1 or newer, ohair@49: make sure it is in your PATH. ohair@25:
  8. ohair@13:
ohair@13:
ohair@13: ohair@13:
ohair@13:

Basic Solaris System Setup

ohair@13:
ohair@13: The minimum recommended hardware for building the ohair@13: Solaris SPARC version is an UltraSPARC with 512 MB of RAM. ohair@13: For building ohair@13: the Solaris x86 version, a Pentium class processor or better and at ohair@13: least 512 MB of RAM are recommended. ohair@13: Approximately 1.4 GB of free disk ohair@13: space is needed for a 32-bit build. ohair@13:

ohair@276: If you are building the 64-bit version, you should ohair@276: run the command "isainfo -v" to verify that you have a ohair@276: 64-bit installation, it should say sparcv9 or ohair@276: amd64. ohair@276: An additional 7 GB of free disk space is needed ohair@276: for a 64-bit build. ohair@13:

ohair@276: The build uses the tools contained in /usr/ccs/bin ohair@276: and /usr/bin of a standard developer or full installation of ohair@276: the Solaris operating environment. ohair@13:

ohair@276: Solaris patches specific to the JDK can be downloaded from the ohair@276: ohair@276: SunSolve JDK Solaris patches download page. ohair@276: You should ensure that the latest patch cluster for ohair@276: your version of the Solaris operating environment has also ohair@276: been installed. ohair@13:

ohair@13: ohair@13:

Basic Solaris Check List

ohair@13:
ohair@13:
    ohair@13:
  1. ohair@13: Install the ohair@13: Bootstrap JDK, set ohair@13: ALT_BOOTDIR. ohair@13:
  2. ohair@13:
  3. ohair@13: Optional Import JDK, set ohair@13: ALT_JDK_IMPORT_PATH. ohair@13:
  4. ohair@13:
  5. ohair@13: Install the ohair@13: Sun Studio Compilers, set ohair@13: ALT_COMPILER_PATH. ohair@13:
  6. ohair@13:
  7. ohair@13: Install the ohair@13: CUPS Include files, set ohair@13: ALT_CUPS_HEADERS_PATH. ohair@13:
  8. ohair@25:
  9. andrew@90: Install the XRender Include files. andrew@90:
  10. andrew@90:
  11. ohair@25: Install ohair@320: Ant 1.7.1 or newer, ohair@49: make sure it is in your PATH. ohair@25:
  12. ohair@13:
ohair@13:
ohair@13: ohair@13:
ohair@13:

Basic Windows System Setup

ohair@13:
ohair@13: i586 only: ohair@49: The minimum recommended hardware for building the 32-bit or X86 ohair@13: Windows version is an Pentium class processor or better, at least ohair@13: 512 MB of RAM, and approximately 600 MB of free disk space. ohair@13: ohair@49: NOTE: The Windows build machines need to use the ohair@13: file system NTFS. ohair@13: Build machines formatted to FAT32 will not work ohair@13: because FAT32 doesn't support case-sensitivity in file names. ohair@13: ohair@13:

ohair@276: X64 only: ohair@276: The minimum recommended hardware for building ohair@276: the Windows X64 version is an AMD Opteron class processor, at least 1 ohair@276: GB of RAM, and approximately 10 GB of free disk space. ohair@13:

ohair@13: ohair@13:

Windows Paths

ohair@13:
duke@2: Windows: ohair@13: Note that GNU make is a historic utility and is based very ohair@13: heavily on shell scripting, so it does not tolerate the Windows habit ohair@13: of having spaces in pathnames or the use of the \characters in pathnames. ohair@13: Luckily on most Windows systems, you can use /instead of \, and ohair@13: there is always a 'short' pathname without spaces for any path that ohair@13: contains spaces. ohair@13: Unfortunately, this short pathname can be somewhat dynamic and the ohair@13: formula is difficult to explain. ohair@13: You can use cygpath utility to map pathnames with spaces ohair@13: or the \character into the C:/ style of pathname ohair@13: (called 'mixed'), e.g. ohair@13: cygpath -s -m "path". ohair@13:

ohair@276: The makefiles will try to translate any pathnames supplied ohair@276: to it into the C:/ style automatically. ohair@13:

ohair@276: Note that use of CYGWIN creates a unique problem with regards to ohair@276: setting PATH. Normally on Windows ohair@276: the PATH variable contains directories ohair@276: separated with the ";" character (Solaris and Linux uses ":"). ohair@276: With CYGWIN, it uses ":", but that means that paths like "C:/path" ohair@276: cannot be placed in the CYGWIN version of PATH and ohair@276: instead CYGWIN uses something like /cygdrive/c/path ohair@276: which CYGWIN understands, but only CYGWIN understands. ohair@276: So be careful with paths on Windows. ohair@13:

ohair@13: ohair@13:

Basic Windows Check List

duke@2:
ohair@13:
    ohair@13:
  1. ohair@13: Install the ohair@13: CYGWIN product. ohair@13:
  2. ohair@13:
  3. ohair@13: Install the ohair@13: Bootstrap JDK, set ohair@13: ALT_BOOTDIR. ohair@13:
  4. ohair@13:
  5. ohair@13: Optional Import JDK, set ohair@13: ALT_JDK_IMPORT_PATH. ohair@13:
  6. ohair@13:
  7. ohair@13: Install the prr@187: Microsoft Visual Studio Compilers). ohair@13:
  8. ohair@13:
  9. ohair@13: Setup all environment variables for compilers prr@187: (see compilers). ohair@13:
  10. ohair@13:
  11. ohair@13: Install ohair@13: Microsoft DirectX SDK. ohair@13:
  12. ohair@25:
  13. ohair@25: Install ohair@320: Ant 1.7.1 or newer, ohair@49: make sure it is in your PATH and set ohair@25: ANT_HOME. ohair@25:
  14. ohair@13:
duke@2:
ohair@13: ohair@13:
ohair@13:

Build Dependencies

duke@2:
ohair@13: Depending on the platform, the OpenJDK build process has some basic ohair@13: dependencies on components not part of the OpenJDK sources. ohair@13: Some of these are specific to a platform, some even specific to ohair@13: an architecture. ohair@13: Each dependency will have a set of ALT variables that can be set ohair@13: to tell the makefiles where to locate the component. ohair@13: In most cases setting these ALT variables may not be necessary ohair@13: and the makefiles will find defaults on the system in standard ohair@13: install locations or through component specific variables. ohair@13: ohair@13:

Bootstrap JDK

ohair@13:
ohair@13: All OpenJDK builds require access to the previously released ohair@13: JDK 6, this is often called a bootstrap JDK. ohair@13: The JDK 6 binaries can be downloaded from Sun's ohair@138: JDK 6 download site. ohair@13: For build performance reasons ohair@13: is very important that this bootstrap JDK be made available on the ohair@13: local disk of the machine doing the build. ohair@13: You should always set ohair@13: ALT_BOOTDIR ohair@13: to point to the location of ohair@13: the bootstrap JDK installation, this is the directory pathname ohair@13: that contains a bin, lib, and include ohair@13: It's also a good idea to also place its bin directory ohair@13: in the PATH environment variable, although it's ohair@13: not required. ohair@13:

ohair@276: Solaris: ohair@276: Some pre-installed JDK images may be available to you in the ohair@276: directory /usr/jdk/instances. ohair@276: If you don't set ohair@276: ALT_BOOTDIR ohair@276: the makefiles will look in that location for a JDK it can use. ohair@13:

ohair@13: ohair@13:

Optional Import JDK

ohair@13:
ohair@13: The ALT_JDK_IMPORT_PATH ohair@13: setting is only needed if you are not building the entire ohair@13: JDK. For example, if you have built the entire JDK once, and ohair@13: wanted to avoid repeatedly building the Hotspot VM, you could ohair@13: set this to the location of the previous JDK install image ohair@13: and the build will copy the needed files from this import area. ohair@13:
ohair@13: ohair@25:

Ant

ohair@25:
ohair@298: All OpenJDK builds require access to least Ant 1.7.1. ohair@25: The Ant tool is available from the ohair@320: ohair@320: Ant 1.7.1 archive download site. ohair@49: You should always make sure ant is in your PATH, and ohair@49: on Windows you may also need to set ohair@25: ANT_HOME ohair@25: to point to the location of ohair@25: the Ant installation, this is the directory pathname ohair@25: that contains a bin and lib. ohair@320:
ohair@320: WARNING: Ant versions used from IDE tools like NetBeans ohair@320: or installed via system packages may not operate the same ohair@320: as the one obtained from the Ant download bundles. ohair@320: These system and IDE installers sometimes choose to change ohair@320: the ant installation enough to cause differences. ohair@25:
ohair@25: ohair@13:

Certificate Authority File (cacert)

ohair@13:
ohair@13: See ohair@276: http://en.wikipedia.org/wiki/Certificate_Authority ohair@13: for a better understanding of the Certificate Authority (CA). ohair@13: A certificates file named "cacerts" ohair@13: represents a system-wide keystore with CA certificates. ohair@13: In JDK and JRE ohair@13: binary bundles, the "cacerts" file contains root CA certificates from ohair@13: several public CAs (e.g., VeriSign, Thawte, and Baltimore). ohair@13: The source contain a cacerts file ohair@13: without CA root certificates. ohair@13: Formal JDK builders will need to secure ohair@13: permission from each public CA and include the certificates into their ohair@13: own custom cacerts file. ohair@13: Failure to provide a populated cacerts file ohair@13: will result in verification errors of a certificate chain during runtime. ohair@13: The variable ohair@13: ALT_CACERTS_FILE ohair@13: can be used to override the default location of the ohair@13: cacerts file that will get placed in your build. ohair@13: By default an empty cacerts file is provided and that should be ohair@13: fine for most JDK developers. ohair@13:
ohair@13: ohair@13:

Compilers

ohair@13:
ohair@13: Linux gcc/binutils ohair@13:
ohair@320: The GNU gcc compiler version should be 4.3 or newer. ohair@13: The compiler used should be the default compiler installed ohair@13: in /usr/bin. ohair@13:
ohair@13: Solaris: Sun Studio ohair@13:
ohair@13: At a minimum, the ohair@211: ohair@276: Sun Studio 12 Update 1 Compilers ohair@211: (containing version 5.10 of the C and C++ compilers) is required, ohair@211: including specific patches. ohair@276:

ohair@211: The Solaris SPARC patch list is: ohair@276:

    ohair@276:
  • ohair@276: 118683-05: SunOS 5.10: Patch for profiling libraries and assembler ohair@276:
  • ohair@276:
  • ohair@276: 119963-21: SunOS 5.10: Shared library patch for C++ ohair@276:
  • ohair@276:
  • ohair@276: 120753-08: SunOS 5.10: Microtasking libraries (libmtsk) patch ohair@276:
  • ohair@276:
  • ohair@276: 128228-09: Sun Studio 12 Update 1: Patch for Sun C++ Compiler ohair@276:
  • ohair@276:
  • ohair@276: 141860-03: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95 ohair@276:
  • ohair@276:
  • ohair@276: 141861-05: Sun Studio 12 Update 1: Patch for Sun C Compiler ohair@276:
  • ohair@276:
  • ohair@276: 142371-01: Sun Studio 12.1 Update 1: Patch for dbx ohair@276:
  • ohair@276:
  • ohair@276: 143384-02: Sun Studio 12 Update 1: Patch for debuginfo handling ohair@276:
  • ohair@276:
  • ohair@276: 143385-02: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C C++ F77 F95 ohair@276:
  • ohair@276:
  • ohair@276: 142369-01: Sun Studio 12.1: Patch for Performance Analyzer Tools ohair@276:
  • ohair@211:
ohair@211:

ohair@276: The Solaris X86 patch list is: ohair@211:

    ohair@276:
  • ohair@276: 119961-07: SunOS 5.10_x86, x64, Patch for profiling libraries and assembler ohair@276:
  • ohair@276:
  • ohair@276: 119964-21: SunOS 5.10_x86: Shared library patch for C++_x86 ohair@276:
  • ohair@276:
  • ohair@276: 120754-08: SunOS 5.10_x86: Microtasking libraries (libmtsk) patch ohair@276:
  • ohair@276:
  • ohair@276: 141858-06: Sun Studio 12 Update 1_x86: Sun Compiler Common patch for x86 backend ohair@276:
  • ohair@276:
  • ohair@276: 128229-09: Sun Studio 12 Update 1_x86: Patch for C++ Compiler ohair@276:
  • ohair@276:
  • ohair@276: 142363-05: Sun Studio 12 Update 1_x86: Patch for C Compiler ohair@276:
  • ohair@276:
  • ohair@276: 142368-01: Sun Studio 12.1_x86: Patch for Performance Analyzer Tools ohair@276:
  • ohair@211:
ohair@13:

ohair@276: Set ohair@276: ALT_COMPILER_PATH ohair@276: to point to the location of ohair@276: the compiler binaries, and place this location in the PATH. ohair@13:

ohair@276: The Oracle Solaris Studio Express compilers at: ohair@276: ohair@276: Oracle Solaris Studio Express Download site ohair@276: are also an option, although these compilers have not ohair@276: been extensively used yet. ohair@13:

prr@187: Windows i586: Microsoft Visual Studio 2010 Compilers ohair@13:
ohair@276:

ohair@320: BEGIN WARNING: JDK 7 has transitioned to ohair@320: use the newest VS2010 Microsoft compilers. ohair@320: No other compilers are known to build the entire JDK, ohair@276: including non-open portions. ohair@276: Visual Studio 2010 Express compilers are now able to build all the ohair@276: open source repositories, but this is 32 bit only. To build 64 bit ohair@320: Windows binaries use the the 7.1 Windows SDK. ohair@320: END WARNING. ohair@276:

ohair@320: The 32-bit OpenJDK Windows build requires ohair@276: Microsoft Visual Studio C++ 2010 (VS2010) Professional ohair@276: Edition or Express compiler. ohair@276: The compiler and other tools are expected to reside ohair@276: in the location defined by the variable ohair@276: VS100COMNTOOLS which ohair@276: is set by the Microsoft Visual Studio installer. ohair@13:

ohair@276: Once the compiler is installed, ohair@276: it is recommended that you run VCVARS32.BAT ohair@276: to set the compiler environment variables ohair@276: INCLUDE, ohair@276: LIB, and ohair@276: PATH ohair@276: prior to building the ohair@276: OpenJDK. ohair@276: The above environment variables MUST be set. ohair@276: This compiler also contains the Windows SDK v 7.0a, ohair@276: which is an update to the Windows 7 SDK. ohair@13:

ohair@276: WARNING: Make sure you check out the ohair@276: CYGWIN link.exe WARNING. ohair@276: The path /usr/bin must be after the path to the ohair@276: Visual Studio product. ohair@13:

prr@187: Windows x64: Microsoft Visual Studio 2010 Professional Compiler ohair@13:
ohair@320: For X64, the set up is much the same as 32 bit prr@175: except that you run amd64\VCVARS64.BAT prr@175: to set the compiler environment variables. ohair@320: Previously 64 bit builds had to use the 64 bit compiler in prr@187: an unbundled Windows SDK but this is no longer necessary if prr@187: you have VS2010 Professional. ohair@13:
prr@187: Windows x64: Microsoft Windows 7.1 SDK 64 bit compilers. ohair@276: For a free alternative for 64 bit builds, use the 7.1 SDK. ohair@276: Microsoft say that to set up your paths for this run ohair@276:
prr@187:     c:\Program Files\Microsoft SDKs\Windows\v7.1\bin\setenv.cmd /x64.
ohair@276:                 
ohair@276: What was tested is just directly setting up LIB, INCLUDE, ohair@276: PATH and based on the installation directories using the ohair@276: DOS short name appropriate for the system, (you will ohair@276: need to set them for yours, not just blindly copy this) eg : ohair@276:
prr@187:     set VSINSTALLDIR=c:\PROGRA~2\MICROS~1.0
prr@187:     set WindowsSdkDir=c:\PROGRA~1\MICROS~1\Windows\v7.1
prr@187:     set PATH=%VSINSTALLDIR%\vc\bin\amd64;%VSINSTALLDIR%\Common7\IDE;%WindowsSdkDir%\bin;%PATH%
prr@187:     set INCLUDE=%VSINSTALLDIR%\vc\include;%WindowsSdkDir%\include
prr@187:     set LIB=%VSINSTALLDIR%\vc\lib\amd64;%WindowsSdkDir%\lib\x64
ohair@276:                 
ohair@13:
ohair@13: ohair@13:

Zip and Unzip

ohair@13:
ohair@13: Version 2.2 (November 3rd 1997) or newer of the zip utility ohair@13: and version 5.12 or newer of the unzip utility is needed ohair@13: to build the JDK. ohair@13: With Solaris, Linux, and Windows CYGWIN, the zip and unzip ohair@13: utilities installed on the system should be fine. ohair@13: Information and the source code for ohair@13: ZIP.EXE and UNZIP.EXE is available on the ohair@13: info-zip web site. ohair@13:
ohair@13: ohair@13:

Common UNIX Printing System (CUPS) Headers (Solaris & Linux)

ohair@13:
ohair@13: Solaris: ohair@13: CUPS header files are required for building the ohair@13: OpenJDK on Solaris. ohair@13: The Solaris header files can be obtained by installing ohair@13: the package SFWcups from the Solaris Software ohair@13: Companion CD/DVD, these often will be installed into ohair@13: /opt/sfw/cups. ohair@13:

ohair@276: Linux: ohair@276: CUPS header files are required for building the ohair@276: OpenJDK on Linux. ohair@276: The Linux header files are usually available from a "cups" ohair@276: development package, it's recommended that you try and use ohair@276: the package provided by the particular version of Linux that ohair@276: you are using. ohair@13:

ohair@276: The CUPS header files can always be downloaded from ohair@276: www.cups.org. ohair@276: The variable ohair@276: ALT_CUPS_HEADERS_PATH ohair@276: can be used to override the default location of the ohair@276: CUPS Header files. ohair@13:

ohair@13: andrew@90:

XRender Extension Headers (Solaris & Linux)

andrew@90:
andrew@90:

ohair@276: Solaris: ohair@276: XRender header files are required for building the ohair@276: OpenJDK on Solaris. ohair@276: The XRender header file is included with the other X11 header files ohair@276: in the package SFWxwinc on new enough versions of ohair@276: Solaris and will be installed in ohair@276: /usr/X11/include/X11/extensions/Xrender.h andrew@90:

ohair@276: Linux: ohair@276: XRender header files are required for building the ohair@276: OpenJDK on Linux. ohair@276: The Linux header files are usually available from a "Xrender" ohair@276: development package, it's recommended that you try and use ohair@276: the package provided by the particular distribution of Linux that ohair@276: you are using. ohair@276:

andrew@90:
andrew@90: ohair@13:

FreeType 2

ohair@13:
ohair@13: Version 2.3 or newer of FreeType is required for building the OpenJDK. ohair@13: On Unix systems required files can be available as part of your ohair@13: distribution (while you still may need to upgrade them). ohair@13: Note that you need development version of package that ohair@13: includes both FreeType library and header files. ohair@13:

ohair@276: You can always download latest FreeType version from the ohair@276: FreeType website. ohair@13:

ohair@276: Makefiles will try to pick FreeType from /usr/lib and /usr/include. ohair@276: In case it is installed elsewhere you will need to set environment ohair@276: variables ohair@276: ALT_FREETYPE_LIB_PATH ohair@276: and ohair@276: ALT_FREETYPE_HEADERS_PATH ohair@276: to refer to place where library and header files are installed. ohair@25:

ohair@276: Building the freetype 2 libraries from scratch is also possible, ohair@276: however on Windows refer to the ohair@276: ohair@276: Windows FreeType DLL build instructions. ohair@25:

ohair@276: Note that by default FreeType is built with byte code hinting ohair@276: support disabled due to licensing restrictions. ohair@276: In this case, text appearance and metrics are expected to ohair@276: differ from Sun's official JDK build. ohair@276: See ohair@276: ohair@276: the SourceForge FreeType2 Home Page ohair@276: ohair@276: for more information. ohair@13:

ohair@13: ohair@13:

Advanced Linux Sound Architecture (ALSA) (Linux only)

ohair@13:
ohair@13: Linux only: ohair@13: Version 0.9.1 or newer of the ALSA files are ohair@13: required for building the OpenJDK on Linux. ohair@13: These Linux files are usually available from an "alsa" ohair@13: of "libasound" ohair@13: development package, it's highly recommended that you try and use ohair@13: the package provided by the particular version of Linux that ohair@13: you are using. ohair@13: The makefiles will check this emit a sanity error if it is ohair@13: missing or the wrong version. ohair@13:

ohair@276: In particular, older Linux systems will likely not have the ohair@276: right version of ALSA installed, for example ohair@276: Redhat AS 2.1 U2 and SuSE 8.1 do not include a sufficiently ohair@276: recent ALSA distribution. ohair@276: On rpm-based systems, you can see if ALSA is installed by ohair@276: running this command: ohair@13:

ohair@13:                     rpm -qa | grep alsa
ohair@13:                 
ohair@13: Both alsa and alsa-devel packages are needed. ohair@13:

ohair@276: If your distribution does not come with ALSA, and you can't ohair@276: find ALSA packages built for your particular system, ohair@276: you can try to install the pre-built ALSA rpm packages from ohair@276: ohair@276: www.freshrpms.net. ohair@276: Note that installing a newer ALSA could ohair@276: break sound output if an older version of ALSA was previously ohair@276: installed on the system, but it will enable JDK compilation. ohair@13:

ohair@13: Installation: execute as root
ohair@13: [i586]: rpm -Uv --force alsa-lib-devel-0.9.1-rh61.i386.rpm
ohair@13: [x64]: rpm -Uv --force alsa-lib-devel-0.9.8-amd64.x86_64.rpm
ohair@13: Uninstallation:
ohair@13: [i586]: rpm -ev alsa-lib-devel-0.9.1-rh61
ohair@13: [x64]:rpm -ev alsa-lib-devel-0.9.8-amd64
ohair@13: Make sure that you do not link to the static library ohair@13: (libasound.a), ohair@13: by verifying that the dynamic library (libasound.so) is ohair@13: correctly installed in /usr/lib. ohair@13:
ohair@13: As a last resort you can go to the ohair@13: ohair@276: Advanced Linux Sound Architecture Site and build it from ohair@13: source. ohair@13:
ohair@13: Download driver and library ohair@13: source tarballs from ohair@13: ALSA's homepage. ohair@13: As root, execute the following ohair@13: commands (you may need to adapt the version number): ohair@13:
ohair@13:                         
ohair@13:                             $ tar xjf alsa-driver-0.9.1.tar.bz2
ohair@13:                             $ cd alsa-driver-0.9.1
ohair@13:                             $ ./configure
ohair@13:                             $ make install
ohair@13:                             $ cd ..
ohair@13:                             $ tar xjf alsa-lib-0.9.1.tar.bz2
ohair@13:                             $ cd alsa-lib-0.9.1
ohair@13:                             $ ./configure
ohair@13:                             $ make install
ohair@13:                         
ohair@13:                     
ohair@13: Should one of the above steps fail, refer to the documentation on ohair@13: ALSA's home page. ohair@13:
ohair@13: Note that this is a minimum install that enables ohair@13: building the JDK platform. To actually use ALSA sound drivers, more ohair@13: steps are necessary as outlined in the documentation on ALSA's homepage. ohair@13:

ohair@276: ALSA can be uninstalled by executing make uninstall first in ohair@276: the alsa-lib-0.9.1 directory and then in ohair@276: alsa-driver-0.9.1. ohair@13:

ohair@13: There are no ALT* variables to change the assumed locations of ALSA, ohair@13: the makefiles will expect to find the ALSA include files and library at: ohair@13: /usr/include/alsa and /usr/lib/libasound.so. duke@2:
ohair@13: ohair@13:

Windows Specific Dependencies

duke@2:
ohair@13: Unix Command Tools (CYGWIN) ohair@13:
ohair@13: The OpenJDK requires access to a set of unix command tools ohair@13: on Windows which can be supplied by ohair@13: CYGWIN. ohair@13:

ohair@276: The OpenJDK build requires CYGWIN version 1.5.12 or newer. ohair@276: Information about CYGWIN can ohair@276: be obtained from the CYGWIN website at ohair@276: www.cygwin.com. ohair@13:

ohair@276: By default CYGWIN doesn't install all the tools required for building ohair@276: the OpenJDK. ohair@276: Along with the default installation, you need to install ohair@276: the following tools. ohair@13:

ohair@13: ohair@13: ohair@13: ohair@13: ohair@41: ohair@13: ohair@13: ohair@13: ohair@13: ohair@13: ohair@13: ohair@13: ohair@13: ohair@41: ohair@41: ohair@13: ohair@13: ohair@13: ohair@13: ohair@41: ohair@41: ohair@13: ohair@13: ohair@13: ohair@13: ohair@41: ohair@41: ohair@13: ohair@13: ohair@13: ohair@13: ohair@41: ohair@41: ohair@13: ohair@13: ohair@25: ohair@13: ohair@41: ohair@41: ohair@13: ohair@13: ohair@13: ohair@13: ohair@41: ohair@41: ohair@13: ohair@13: ohair@13: ohair@25: ohair@41: ohair@41: ohair@13: ohair@13: ohair@13: ohair@25: ohair@41: ohair@41: ohair@13: ohair@13: ohair@13: ohair@41: ohair@41: ohair@41: ohair@13: ohair@13: ohair@13:
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary ohair@276: utilities
make.exeDevelmakeThe GNU version of the 'make' utility built for CYGWIN.
ohair@276: NOTE: See the GNU make section
m4.exeInterpretersm4GNU implementation of the traditional Unix macro ohair@276: processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using 'magic' numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system
ohair@13:
ohair@13:

ohair@276: Note that the CYGWIN software can conflict with other non-CYGWIN ohair@276: software on your Windows system. ohair@276: CYGWIN provides a ohair@276: FAQ for ohair@276: known issues and problems, of particular interest is the ohair@276: section on ohair@276: ohair@276: BLODA (applications that interfere with CYGWIN). ohair@41:

ohair@276: WARNING: ohair@276: Be very careful with link.exe, it will conflict ohair@276: with the Visual Studio version. You need the Visual Studio ohair@276: version of link.exe, not the CYGWIN one. ohair@276: So it's important that the Visual Studio paths in PATH preceed ohair@276: the CYGWIN path /usr/bin. ohair@13:

ohair@13: Microsoft DirectX 9.0 SDK header files and libraries duke@2:
ohair@13: Microsoft DirectX 9.0 SDK (Summer 2004) ohair@13: headers are required for building ohair@13: OpenJDK. ohair@13: This SDK can be downloaded from ohair@13: ohair@276: Microsoft DirectX 9.0 SDK (Summer 2004). ohair@13: If the link above becomes obsolete, the SDK can be found from ohair@13: the Microsoft Download Site ohair@13: (search with "DirectX 9.0 SDK Update Summer 2004"). ohair@13: The location of this SDK can be set with ohair@13: ALT_DXSDK_PATH ohair@13: but it's normally found via the DirectX environment variable ohair@13: DXSDK_DIR. ohair@13:
ohair@291: MSVCR100.DLL ohair@13:
prr@175: The OpenJDK build requires access to a redistributable prr@175: MSVCR100.DLL. prr@175: This is usually picked up automatically from the redist prr@175: directories of Visual Studio 2010. prr@175: If this cannot be found set the ohair@291: ALT_MSVCRNN_DLL_PATH ohair@49: variable to the location of this file. ohair@13:

duke@2:

duke@2:
ohair@13: ohair@13:
ohair@13:

Creating the Build

duke@2:
ohair@13: Once a machine is setup to build the OpenJDK, ohair@13: the steps to create the build are fairly simple. ohair@13: The various ALT settings can either be made into variables ohair@13: or can be supplied on the ohair@13: gmake ohair@13: command. ohair@13:
    ohair@13:
  1. Use the sanity rule to double check all the ALT settings: ohair@13:
    ohair@13: ohair@13: gmake ohair@13: sanity ohair@13: [ARCH_DATA_MODEL=32 or 64] ohair@13: [other "ALT_" overrides] ohair@13: ohair@13:
    ohair@13:
  2. ohair@13:
  3. Start the build with the command: ohair@13:
    ohair@13: ohair@13: gmake ohair@13: [ARCH_DATA_MODEL=32 or 64] ohair@13: [ALT_OUTPUTDIR=output_directory] ohair@13: [other "ALT_" overrides] ohair@13: ohair@13:
    ohair@13:
  4. ohair@13:
duke@2:

ohair@276: Solaris: ohair@276: Note that ARCH_DATA_MODEL is really only needed on Solaris to ohair@276: indicate you want to built the 64-bit version. ohair@276: And before the Solaris 64-bit binaries can be used, they ohair@276: must be merged with the binaries from a separate 32-bit build. ohair@276: The merged binaries may then be used in either 32-bit or 64-bit mode, with ohair@276: the selection occurring at runtime ohair@276: with the -d32 or -d64 options. duke@2:

ohair@13: ohair@13:
ohair@13:

Testing the Build

ohair@13:
ohair@13: When the build is completed, you should see the generated ohair@13: binaries and associated files in the j2sdk-image ohair@13: directory in the output directory. ohair@13: The default output directory is ohair@13: build/platform, ohair@13: where platform is one of ohair@276:
ohair@276: ohair@276:
ohair@13: In particular, the ohair@13: build/platform/j2sdk-image/bin ohair@13: directory should contain executables for the ohair@13: OpenJDK tools and utilities. duke@2:

ohair@276: You can test that the build completed properly by using the build ohair@276: to run the various demos that you will find in the ohair@276: build/platform/j2sdk-image/demo ohair@276: directory. ohair@13:

ohair@276: The provided regression tests can be run with the jtreg ohair@276: utility from ohair@276: the jtreg site. duke@2:

ohair@13: ohair@13:
ohair@13:

Environment/Make Variables

ohair@13:

ohair@276: Some of the ohair@276: environment or make variables (just called variables in this ohair@276: document) that can impact the build are: duke@2:

duke@2:
ohair@49:
PATH
ohair@49:
Typically you want to set the PATH to include: ohair@49:
    ohair@49:
  • The location of the GNU make binary
  • ohair@49:
  • The location of the Bootstrap JDK java ohair@276: (see Bootstrap JDK)
  • ohair@49:
  • The location of the C/C++ compilers ohair@276: (see compilers)
  • ohair@49:
  • The location or locations for the Unix command utilities ohair@276: (e.g. /usr/bin)
  • ohair@49:
ohair@49:
ohair@49:
MILESTONE
ohair@49:
ohair@49: The milestone name for the build (e.g."beta"). ohair@49: The default value is "internal". ohair@49:
ohair@49:
BUILD_NUMBER
ohair@49:
ohair@49: The build number for the build (e.g. "b27"). ohair@49: The default value is "b00". ohair@49:
ohair@49:
ARCH_DATA_MODEL
ohair@49:
The ARCH_DATA_MODEL variable ohair@49: is used to specify whether the build is to generate 32-bit or 64-bit ohair@49: binaries. ohair@49: The Solaris build supports either 32-bit or 64-bit builds, but ohair@49: Windows and Linux will support only one, depending on the specific ohair@49: OS being used. ohair@49: Normally, setting this variable is only necessary on Solaris. ohair@49: Set ARCH_DATA_MODEL to 32 for generating 32-bit binaries, ohair@49: or to 64 for generating 64-bit binaries. ohair@49:
ohair@49:
ALT_BOOTDIR
ohair@49:
ohair@49: The location of the bootstrap JDK installation. ohair@49: See Bootstrap JDK for more information. ohair@49: You should always install your own local Bootstrap JDK and ohair@49: always set ALT_BOOTDIR explicitly. ohair@49:
ohair@49:
ALT_JDK_IMPORT_PATH
duke@2:
ohair@49: The location of a previously built JDK installation. ohair@49: See Optional Import JDK for more information. ohair@49:
ohair@49:
ALT_OUTPUTDIR
ohair@49:
ohair@49: An override for specifying the (absolute) path of where the ohair@49: build output is to go. ohair@49: The default output directory will be build/platform. ohair@49:
ohair@49:
ALT_COMPILER_PATH
ohair@49:
ohair@49: The location of the C/C++ compiler. ohair@49: The default varies depending on the platform. ohair@49:
ohair@49:
ALT_CACERTS_FILE
ohair@49:
ohair@49: The location of the cacerts file. ohair@49: The default will refer to ohair@49: jdk/src/share/lib/security/cacerts. ohair@49:
ohair@49:
ALT_CUPS_HEADERS_PATH
ohair@49:
ohair@49: The location of the CUPS header files. ohair@49: See CUPS information for more information. ohair@49: If this path does not exist the fallback path is ohair@49: /usr/include. ohair@49:
ohair@49:
ALT_FREETYPE_LIB_PATH
ohair@49:
ohair@49: The location of the FreeType shared library. ohair@49: See FreeType information for details. ohair@49:
ohair@49:
ALT_FREETYPE_HEADERS_PATH
ohair@49:
ohair@49: The location of the FreeType header files. ohair@49: See FreeType information for details. ohair@49:
ohair@49:
ALT_JDK_DEVTOOLS_PATH
ohair@49:
ohair@49: The default root location of the devtools. ohair@49: The default value is ohair@49: $(ALT_SLASH_JAVA)/devtools. ohair@49:
ohair@49:
ALT_DEVTOOLS_PATH
ohair@49:
ohair@49: The location of tools like the ohair@49: zip and unzip ohair@49: binaries, but might also contain the GNU make utility ohair@49: (gmake). ohair@49: So this area is a bit of a grab bag, especially on Windows. ohair@49: The default value depends on the platform and ohair@49: Unix Commands being used. ohair@49: On Linux the default will be ohair@49: $(ALT_JDK_DEVTOOLS_PATH)/linux/bin, ohair@49: on Solaris ohair@49: $(ALT_JDK_DEVTOOLS_PATH)/{sparc,i386}/bin, ohair@49: and on Windows with CYGWIN ohair@49: /usr/bin. ohair@49:
ohair@320:
ALT_DROPS_DIR
ohair@320:
ohair@320: The location of any source drop bundles ohair@320: (see Managing the Source Drops). ohair@320: The default will be ohair@320: $(ALT_JDK_DEVTOOLS_PATH)/share/jdk7-drops. ohair@320:
ohair@49:
ALT_UNIXCCS_PATH
ohair@49:
ohair@49: Solaris only: ohair@49: An override for specifying where the Unix CCS ohair@49: command set are located. ohair@49: The default location is /usr/ccs/bin ohair@49:
ohair@49:
ALT_SLASH_JAVA
ohair@49:
ohair@49: The default root location for many of the ALT path locations ohair@49: of the following ALT variables. ohair@49: The default value is ohair@49: "/java" on Solaris and Linux, ohair@49: "J:" on Windows. ohair@49:
ohair@49:
ALT_BUILD_JDK_IMPORT_PATH
ohair@49:
ohair@49: These are useful in managing builds on multiple platforms. ohair@49: The default network location for all of the import JDK images ohair@49: for all platforms. ohair@49: If ALT_JDK_IMPORT_PATH ohair@49: is not set, this directory will be used and should contain ohair@49: the following directories: ohair@49: solaris-sparc, ohair@49: solaris-i586, ohair@49: solaris-sparcv9, ohair@49: solaris-amd64, ohair@49: linux-i586, ohair@49: linux-amd64, ohair@49: windows-i586, ohair@49: and ohair@49: windows-amd64. ohair@49: Where each of these directories contain the import JDK image ohair@49: for that platform. duke@2:
dholmes@323:
ALT_OPENWIN_HOME
dholmes@323:
dholmes@323: The top-level directory of the libraries and include files for the platform's dholmes@323: graphical programming environment. The default location is platform specific. dholmes@323: For example, on Linux it defaults to /usr/X11R6/. dholmes@323:
ohair@49:
Windows specific:
ohair@13:
ohair@49:
ohair@275:
ALT_WINDOWSSDKDIR
ohair@49:
ohair@49: The location of the ohair@275: Microsoft Windows SDK where some tools will be ohair@275: located. ohair@275: The default is whatever WINDOWSSDKDIR is set to ohair@275: (or WindowsSdkDir) or the path ohair@320:
ohair@320: c:\Program Files\Microsoft SDKs\Windows\v7.0a ohair@49:
ohair@49:
ALT_DXSDK_PATH
ohair@49:
ohair@49: The location of the ohair@49: Microsoft DirectX 9 SDK. ohair@49: The default will be to try and use the DirectX environment ohair@49: variable DXSDK_DIR, ohair@49: failing that, look in C:/DXSDK. ohair@49:
prr@175:
ALT_MSVCRNN_DLL_PATH
ohair@49:
ohair@49: The location of the ohair@291: MSVCR100.DLL. ohair@49:
ohair@49:
duke@2:
dholmes@323:
Cross-Compilation Support:
dholmes@323:
dholmes@323:
dholmes@323:
CROSS_COMPILE_ARCH
dholmes@323:
dholmes@323: Set to the target architecture of a cross-compilation build. If set, this dholmes@323: variable is used to signify that we are cross-compiling. The expectation dholmes@323: is that ALT_COMPILER_PATH is set dholmes@323: to point to the cross-compiler and that any cross-compilation specific flags dholmes@323: are passed using EXTRA_CFLAGS. dholmes@323: The ALT_OPENWIN_HOME variable should dholmes@323: also be set to point to the graphical header files (e.g. X11) provided with dholmes@323: the cross-compiler. dholmes@323: When cross-compiling we skip execution of any demos etc that may be built, and dholmes@323: also skip binary-file verification. dholmes@323:
dholmes@323:
EXTRA_CFLAGS
dholmes@323:
dholmes@323: Used to pass cross-compilation options to the cross-compiler. dholmes@323: These are added to the CFLAGS and CXXFLAGS variables. dholmes@323:
dholmes@323:
USE_ONLY_BOOTDIR_TOOLS
dholmes@323:
dholmes@323: Used primarily for cross-compilation builds (and always set in that case) dholmes@323: this variable indicates that tools from the boot JDK should be used during dholmes@323: the build process, not the tools (javac, javah, jar) dholmes@323: just built (which can't execute on the build host). dholmes@323:
dholmes@323:
HOST_CC
dholmes@323:
dholmes@323: The location of the C compiler to generate programs to run on the build host. dholmes@323: Some parts of the build generate programs that are then compiled and executed dholmes@323: to produce other parts of the build. Normally the primary C compiler is used dholmes@323: to do this, but when cross-compiling that would be the cross-compiler and the dholmes@323: resulting program could not be executed. dholmes@323: On Linux this defaults to /usr/bin/gcc; on other platforms it must be dholmes@323: set explicitly. dholmes@323:
dholmes@323:
dholmes@323:
Specialized Build Options:
dholmes@323:
dholmes@323: Some build variables exist to support specialized build environments and/or specialized dholmes@323: build products. Their use is only supported in those contexts: dholmes@323:
dholmes@323:
BUILD_CLIENT_ONLY
dholmes@323:
dholmes@323: Indicates this build will only contain the Hotspot client VM. In addition to dholmes@323: controlling the Hotspot build target, it ensures that we don't try to copy dholmes@323: any server VM files/directories, and defines a default jvm.cfg file dholmes@323: suitable for a client-only environment. Using this in a 64-bit build will dholmes@323: generate a sanity warning as 64-bit client builds are not directly supported. dholmes@323:
dholmes@323:
BUILD_HEADLESS_ONLY
dholmes@323:
dholmes@323: Used when the build environment has no graphical capabilities at all. This dholmes@323: excludes building anything that requires graphical libraries to be available. dholmes@323:
dholmes@323:
JAVASE_EMBEDDED
dholmes@323:
dholmes@323: Used to indicate this is a build of the Oracle Java SE Embedded product. dholmes@323: This will enable the directives included in the SE-Embedded specific build dholmes@323: files. dholmes@323:
dholmes@323:
LIBZIP_CAN_USE_MMAP
dholmes@323:
dholmes@323: If set to false, disables the use of mmap by the zip utility. Otherwise, dholmes@323: mmap will be used. dholmes@323:
dholmes@323:
COMPRESS_JARS
dholmes@323:
dholmes@323: If set to true, causes certain jar files that would otherwise be built without dholmes@323: compression, to use compression. dholmes@323:
dholmes@323:
dholmes@323:
duke@2:
ohair@13:
ohair@13: ohair@13:
ohair@320:

Hints and Tips

ohair@320:
ohair@320: You don't have to use all these hints and tips, and in fact people do actually ohair@320: build with systems that contradict these, but they might prove to be ohair@320: helpful to some. ohair@320: ohair@320:
ohair@320: ohair@320:
ohair@13:

Troubleshooting

ohair@13:
ohair@13: A build can fail for any number of reasons. ohair@13: Most failures ohair@13: are a result of trying to build in an environment in which all the ohair@13: pre-build requirements have not been met. ohair@13: The first step in ohair@13: troubleshooting a build failure is to recheck that you have satisfied ohair@13: all the pre-build requirements for your platform. ohair@13: Look for the check list of the platform you are building on in the ohair@13: Table of Contents. ohair@13:

ohair@276: You can validate your build environment by using the sanity ohair@276: target. ohair@276: Any errors listed ohair@276: will stop the build from starting, and any warnings may result in ohair@276: a flawed product build. ohair@276: We strongly encourage you to evaluate every ohair@276: sanity check warning and fix it if required, before you proceed ohair@276: further with your build. ohair@13:

ohair@276: Some of the more common problems with builds are briefly described ohair@276: below, with suggestions for remedies. ohair@13:

ohair@13:
ohair@13:
ohair@13: ohair@13: