aoqi@0: aoqi@0: aoqi@0: aoqi@0: OpenJDK Build README aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
aoqi@0: OpenJDK aoqi@0:
aoqi@0:

OpenJDK Build README

aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Introduction

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

!!!!!!!!!!!!!!! THIS IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!

aoqi@0:
aoqi@0: Some Headlines: aoqi@0: aoqi@0:
aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Contents

aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Use of Mercurial

aoqi@0:
aoqi@0: The OpenJDK sources are maintained with the revision control system aoqi@0: Mercurial. aoqi@0: If you are new to Mercurial, please see the aoqi@0: aoqi@0: Beginner Guides aoqi@0: or refer to the aoqi@0: Mercurial Book. aoqi@0: The first few chapters of the book provide an excellent overview of aoqi@0: Mercurial, what it is and how it works. aoqi@0:
aoqi@0: For using Mercurial with the OpenJDK refer to the aoqi@0: aoqi@0: Developer Guide: Installing and Configuring Mercurial aoqi@0: section for more information. aoqi@0: aoqi@0:

Getting the Source

aoqi@0:
aoqi@0: To get the entire set of OpenJDK Mercurial repositories aoqi@0: use the script get_source.sh located in the aoqi@0: root repository: aoqi@0:
aoqi@0: aoqi@0: hg clone http://hg.openjdk.java.net/jdk8/jdk8 aoqi@0: YourOpenJDK aoqi@0:
aoqi@0: cd YourOpenJDK aoqi@0:
aoqi@0: bash ./get_source.sh aoqi@0:
aoqi@0:
aoqi@0: Once you have all the repositories, keep in mind that each aoqi@0: repository is its own independent repository. aoqi@0: You can also re-run ./get_source.sh anytime to aoqi@0: pull over all the latest changesets in all the repositories. aoqi@0: This set of nested repositories has been given the term aoqi@0: "forest" and there are various ways to apply the same aoqi@0: hg command to each of the repositories. aoqi@0: For example, the script make/scripts/hgforest.sh aoqi@0: can be used to repeat the same hg aoqi@0: command on every repository, e.g. aoqi@0:
aoqi@0: aoqi@0: cd YourOpenJDK aoqi@0:
aoqi@0: bash ./make/scripts/hgforest.sh status aoqi@0:
aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:

Repositories

aoqi@0:
aoqi@0:

The set of repositories and what they contain:

aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
RepositoryContains
aoqi@0: . (root) aoqi@0: aoqi@0: common configure and makefile logic aoqi@0:
aoqi@0: hotspot aoqi@0: aoqi@0: source code and make files for building aoqi@0: the OpenJDK Hotspot Virtual Machine aoqi@0:
aoqi@0: langtools aoqi@0: aoqi@0: source code for the OpenJDK javac and language tools aoqi@0:
aoqi@0: jdk aoqi@0: aoqi@0: source code and make files for building aoqi@0: the OpenJDK runtime libraries and misc files aoqi@0:
aoqi@0: jaxp aoqi@0: aoqi@0: source code for the OpenJDK JAXP functionality aoqi@0:
aoqi@0: jaxws aoqi@0: aoqi@0: source code for the OpenJDK JAX-WS functionality aoqi@0:
aoqi@0: corba aoqi@0: aoqi@0: source code for the OpenJDK Corba functionality aoqi@0:
aoqi@0: nashorn aoqi@0: aoqi@0: source code for the OpenJDK JavaScript implementation aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:

Repository Source Guidelines

aoqi@0:
aoqi@0: There are some very basic guidelines: aoqi@0: aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Building

aoqi@0:
aoqi@0: The very first step in building the OpenJDK is making sure the aoqi@0: system itself has everything it needs to do OpenJDK builds. aoqi@0: Once a system is setup, it generally doesn't need to be done again. aoqi@0:
aoqi@0: Building the OpenJDK is now done with running a aoqi@0: configure aoqi@0: script which will try and find and verify you have everything aoqi@0: you need, followed by running aoqi@0: make, e.g. aoqi@0:
aoqi@0: aoqi@0: aoqi@0: bash ./configure
aoqi@0: make all aoqi@0:
aoqi@0:
aoqi@0:
aoqi@0: Where possible the configure script will attempt to located the aoqi@0: various components in the default locations or via component aoqi@0: specific variable settings. aoqi@0: When the normal defaults fail or components cannot be found, aoqi@0: additional configure options may be necessary to help configure aoqi@0: find the necessary tools for the build, or you may need to aoqi@0: re-visit the setup of your system due to missing software aoqi@0: packages. aoqi@0:
aoqi@0: NOTE: The configure script aoqi@0: file does not have aoqi@0: execute permissions and will need to be explicitly run with aoqi@0: bash, aoqi@0: see the source guidelines. aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

System Setup

aoqi@0:
aoqi@0: Before even attempting to use a system to build the OpenJDK aoqi@0: there are some very basic system setups needed. aoqi@0: For all systems: aoqi@0: aoqi@0: And for specific systems: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
LinuxSolarisWindowsMac OS X
aoqi@0: Install all the software development aoqi@0: packages needed including aoqi@0: alsa, aoqi@0: freetype, aoqi@0: cups, and aoqi@0: xrender. aoqi@0:
aoqi@0: See aoqi@0: specific system packages. aoqi@0:
aoqi@0: Install all the software development aoqi@0: packages needed including aoqi@0: Studio Compilers, aoqi@0: freetype, aoqi@0: cups, and aoqi@0: xrender. aoqi@0:
aoqi@0: See aoqi@0: specific system packages. aoqi@0:
aoqi@0: aoqi@0: aoqi@0: Install aoqi@0: XCode 4.5.2 aoqi@0: and also install the "Command line tools" found under the aoqi@0: preferences pane "Downloads" aoqi@0:
aoqi@0: aoqi@0:

Linux

aoqi@0:
aoqi@0: With Linux, try and favor the system packages over aoqi@0: building your own aoqi@0: or getting packages from other areas. aoqi@0: Most Linux builds should be possible with the system's aoqi@0: available packages. aoqi@0:
aoqi@0: Note that some Linux systems have a habit of pre-populating aoqi@0: your environment variables for you, for example JAVA_HOME aoqi@0: might get pre-defined for you to refer to the JDK installed on aoqi@0: your Linux system. aoqi@0: You will need to unset JAVA_HOME. aoqi@0: It's a good idea to run env and verify the aoqi@0: environment variables you are getting from the default system aoqi@0: settings make sense for building the OpenJDK. aoqi@0: aoqi@0:
aoqi@0: aoqi@0:

Solaris

aoqi@0:
aoqi@0:
Studio Compilers
aoqi@0:
aoqi@0: At a minimum, the aoqi@0: aoqi@0: Studio 12 Update 1 Compilers aoqi@0: (containing version 5.10 of the C and C++ compilers) is required, aoqi@0: including specific patches. aoqi@0:

aoqi@0: The Solaris SPARC patch list is: aoqi@0:

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

aoqi@0: The Solaris X86 patch list is: aoqi@0:

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

aoqi@0: Place the bin directory in PATH. aoqi@0:

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

aoqi@0: aoqi@0:
aoqi@0: aoqi@0:

Windows

aoqi@0:
aoqi@0: aoqi@0:
Windows Unix Toolkit
aoqi@0:
aoqi@0: Building on Windows requires a Unix-like environment, notably a aoqi@0: Unix-like shell. aoqi@0: There are several such environments available of which aoqi@0: Cygwin and aoqi@0: MinGW/MSYS are aoqi@0: currently supported for aoqi@0: the OpenJDK build. One of the differences of these aoqi@0: systems from standard Windows tools is the way aoqi@0: they handle Windows path names, particularly path names which contain aoqi@0: spaces, backslashes as path separators and possibly drive letters. aoqi@0: Depending aoqi@0: on the use case and the specifics of each environment these path aoqi@0: problems can aoqi@0: be solved by a combination of quoting whole paths, translating aoqi@0: backslashes to aoqi@0: forward slashes, escaping backslashes with additional backslashes and aoqi@0: translating the path names to their aoqi@0: aoqi@0: "8.3" version. aoqi@0: aoqi@0:
CYGWIN
aoqi@0:
aoqi@0: CYGWIN is an open source, Linux-like environment which tries to emulate aoqi@0: a complete POSIX layer on Windows. It tries to be smart about path names aoqi@0: and can usually handle all kinds of paths if they are correctly quoted aoqi@0: or escaped although internally it maps drive letters <drive>: aoqi@0: to a virtual directory /cygdrive/<drive>. aoqi@0:

aoqi@0: You can always use the cygpath utility to map pathnames with spaces aoqi@0: or the backslash character into the C:/ style of pathname aoqi@0: (called 'mixed'), e.g. cygpath -s -m "path". aoqi@0:

aoqi@0:

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

aoqi@0:

aoqi@0: The OpenJDK build requires CYGWIN version 1.7.16 or newer. aoqi@0: Information about CYGWIN can aoqi@0: be obtained from the CYGWIN website at aoqi@0: www.cygwin.com. aoqi@0:

aoqi@0:

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

aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
Binary NameCategoryPackageDescription
ar.exeDevelbinutils aoqi@0: The GNU assembler, linker and binary utilities aoqi@0:
make.exeDevelmake aoqi@0: The GNU version of the 'make' utility built for CYGWIN aoqi@0:
m4.exeInterpretersm4 aoqi@0: GNU implementation of the traditional Unix macro aoqi@0: processor aoqi@0:
cpio.exeUtilscpio aoqi@0: A program to manage archives of files aoqi@0:
gawk.exeUtilsawk aoqi@0: Pattern-directed scanning and processing language aoqi@0:
file.exeUtilsfile aoqi@0: Determines file type using 'magic' numbers aoqi@0:
zip.exeArchivezip aoqi@0: Package and compress (archive) files aoqi@0:
unzip.exeArchiveunzip aoqi@0: Extract compressed files in a ZIP archive aoqi@0:
free.exeSystemprocps aoqi@0: Display amount of free and used memory in the system aoqi@0:
aoqi@0:
aoqi@0: Note that the CYGWIN software can conflict with other non-CYGWIN aoqi@0: software on your Windows system. aoqi@0: CYGWIN provides a aoqi@0: FAQ for aoqi@0: known issues and problems, of particular interest is the aoqi@0: section on aoqi@0: aoqi@0: BLODA (applications that interfere with CYGWIN). aoqi@0:
aoqi@0: aoqi@0:
MinGW/MSYS
aoqi@0:
aoqi@0: MinGW ("Minimalist GNU for Windows") is a collection of free Windows aoqi@0: specific header files and import libraries combined with GNU toolsets that aoqi@0: allow one to produce native Windows programs that do not rely on any aoqi@0: 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building aoqi@0: applications and programs which rely on traditional UNIX tools to aoqi@0: be present. Among others this includes tools like bash aoqi@0: and make. aoqi@0: See MinGW/MSYS aoqi@0: for more information. aoqi@0:

aoqi@0: Like Cygwin, MinGW/MSYS can handle different types of path formats. They aoqi@0: are internally converted to paths with forward slashes and drive letters aoqi@0: <drive>: replaced by a virtual aoqi@0: directory /<drive>. Additionally, MSYS automatically aoqi@0: detects binaries compiled for the MSYS environment and feeds them with the aoqi@0: internal, Unix-style path names. If native Windows applications are called aoqi@0: from within MSYS programs their path arguments are automatically converted aoqi@0: back to Windows style path names with drive letters and backslashes as aoqi@0: path separators. This may cause problems for Windows applications which aoqi@0: use forward slashes as parameter separator (e.g. cl /nologo /I) aoqi@0: because MSYS may wrongly aoqi@0: replace such parameters by drive letters. aoqi@0:

aoqi@0:

aoqi@0: In addition to the tools which will be installed aoqi@0: by default, you have aoqi@0: to manually install the aoqi@0: msys-zip and aoqi@0: msys-unzip packages. aoqi@0: This can be easily done with the MinGW command line installer: aoqi@0:

aoqi@0: mingw-get.exe install msys-zip aoqi@0:
aoqi@0: mingw-get.exe install msys-unzip aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0:
Visual Studio 2010 Compilers
aoqi@0:
aoqi@0:

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

aoqi@0:

aoqi@0: Only the C++ part of VS2010 is needed. aoqi@0: Try to let the installation go to the default aoqi@0: install directory. aoqi@0: Always reboot your system after installing VS2010. aoqi@0: The system environment variable VS100COMNTOOLS aoqi@0: should be aoqi@0: set in your environment. aoqi@0:

aoqi@0:

aoqi@0: Make sure that TMP and TEMP are also set aoqi@0: in the environment aoqi@0: and refer to Windows paths that exist, aoqi@0: like C:\temp, aoqi@0: not /tmp, not /cygdrive/c/temp, aoqi@0: and not C:/temp. aoqi@0: C:\temp is just an example, aoqi@0: it is assumed that this area is aoqi@0: private to the user, so by default aoqi@0: after installs you should aoqi@0: see a unique user path in these variables. aoqi@0:

aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0: aoqi@0:

Mac OS X

aoqi@0:
aoqi@0: Make sure you get the right XCode version. aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Configure

aoqi@0:
aoqi@0: The basic invocation of the configure script aoqi@0: looks like: aoqi@0:
aoqi@0: bash ./configure [options] aoqi@0:
aoqi@0: This will create an output directory containing the aoqi@0: "configuration" and setup an area for the build result. aoqi@0: This directory typically looks like: aoqi@0:
aoqi@0: build/linux-x64-normal-server-release aoqi@0:
aoqi@0: configure will try to figure out what system you are running on aoqi@0: and where all necessary build components are. aoqi@0: If you have all prerequisites for building installed, aoqi@0: it should find everything. aoqi@0: If it fails to detect any component automatically, aoqi@0: it will exit and inform you about the problem. aoqi@0: When this happens, read more below in aoqi@0: the configure options. aoqi@0:

aoqi@0: Some examples: aoqi@0:

aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
DescriptionConfigure Command Line
Windows 32bit build with freetype specified aoqi@0: bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32 aoqi@0:
Debug 64bit Build aoqi@0: bash ./configure --enable-debug --with-target-bits=64 aoqi@0:
aoqi@0: aoqi@0: aoqi@0:

Configure Options

aoqi@0:
aoqi@0: Complete details on all the OpenJDK configure options can aoqi@0: be seen with: aoqi@0:
aoqi@0: bash ./configure --help=short aoqi@0:
aoqi@0: Use -help to see all the configure options aoqi@0: available. aoqi@0: aoqi@0: You can generate any number of different configurations, aoqi@0: e.g. debug, release, 32, 64, etc. aoqi@0: aoqi@0: Some of the more commonly used configure options are: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
OpenJDK Configure OptionDescription
--enable-debug aoqi@0: set the debug level to fastdebug (this is a shorthand for aoqi@0: --with-debug-level=fastdebug) aoqi@0:
--with-alsa=path aoqi@0: select the location of the aoqi@0: Advanced Linux Sound Architecture (ALSA) aoqi@0:
aoqi@0: Version 0.9.1 or newer of the ALSA files are aoqi@0: required for building the OpenJDK on Linux. aoqi@0: These Linux files are usually available from an "alsa" aoqi@0: of "libasound" aoqi@0: development package, aoqi@0: and it's highly recommended that you try and use aoqi@0: the package provided by the particular version of Linux that aoqi@0: you are using. aoqi@0:
--with-boot-jdk=path aoqi@0: select the Bootstrap JDK aoqi@0:
--with-boot-jdk-jvmargs="args" aoqi@0: provide the JVM options to be used to run the aoqi@0: Bootstrap JDK aoqi@0:
--with-cacerts=path aoqi@0: select the path to the cacerts file. aoqi@0:
aoqi@0: See aoqi@0: http://en.wikipedia.org/wiki/Certificate_Authority aoqi@0: for a better understanding of the Certificate Authority (CA). aoqi@0: A certificates file named "cacerts" aoqi@0: represents a system-wide keystore with CA certificates. aoqi@0: In JDK and JRE aoqi@0: binary bundles, the "cacerts" file contains root CA certificates from aoqi@0: several public CAs (e.g., VeriSign, Thawte, and Baltimore). aoqi@0: The source contain a cacerts file aoqi@0: without CA root certificates. aoqi@0: Formal JDK builders will need to secure aoqi@0: permission from each public CA and include the certificates into their aoqi@0: own custom cacerts file. aoqi@0: Failure to provide a populated cacerts file aoqi@0: will result in verification errors of a certificate chain during runtime. aoqi@0: By default an empty cacerts file is provided and that should be aoqi@0: fine for most JDK developers. aoqi@0:
--with-cups=path aoqi@0: select the CUPS install location aoqi@0:
aoqi@0: The aoqi@0: Common UNIX Printing System (CUPS) Headers aoqi@0: are required for building the aoqi@0: OpenJDK on Solaris and Linux. aoqi@0: The Solaris header files can be obtained by installing aoqi@0: the package SFWcups from the Solaris Software aoqi@0: Companion CD/DVD, these often will be installed into the aoqi@0: directory /opt/sfw/cups. aoqi@0:
aoqi@0: The CUPS header files can always be downloaded from aoqi@0: www.cups.org. aoqi@0:
--with-cups-include=path aoqi@0: select the CUPS include directory location aoqi@0:
--with-debug-level=level aoqi@0: select the debug information level of release, aoqi@0: fastdebug, or slowdebug aoqi@0:
--with-dev-kit=path aoqi@0: select location of the compiler install or aoqi@0: developer install location aoqi@0:
--with-freetype=path aoqi@0: select the freetype files to use. aoqi@0:
aoqi@0: Expecting the aoqi@0: freetype libraries under aoqi@0: lib/ and the aoqi@0: headers under include/. aoqi@0:
aoqi@0: Version 2.3 or newer of FreeType is required. aoqi@0: On Unix systems required files can be available as part of your aoqi@0: distribution (while you still may need to upgrade them). aoqi@0: Note that you need development version of package that aoqi@0: includes both the FreeType library and header files. aoqi@0:
aoqi@0: You can always download latest FreeType version from the aoqi@0: FreeType website. aoqi@0:
aoqi@0: Building the freetype 2 libraries from scratch is also possible, aoqi@0: however on Windows refer to the aoqi@0: aoqi@0: Windows FreeType DLL build instructions. aoqi@0:
aoqi@0: Note that by default FreeType is built with byte code hinting aoqi@0: support disabled due to licensing restrictions. aoqi@0: In this case, text appearance and metrics are expected to aoqi@0: differ from Sun's official JDK build. aoqi@0: See aoqi@0: aoqi@0: the SourceForge FreeType2 Home Page aoqi@0: aoqi@0: for more information. aoqi@0:
--with-import-hotspot=path aoqi@0: select the location to find hotspot aoqi@0: binaries from a previous build to avoid building aoqi@0: hotspot aoqi@0:
--with-target-bits=arg aoqi@0: select 32 or 64 bit build aoqi@0:
--with-jvm-variants=variants aoqi@0: select the JVM variants to build from, comma aoqi@0: separated list that can include: aoqi@0: server, client, kernel, zero and zeroshark aoqi@0:
--with-memory-size=size aoqi@0: select the RAM size that GNU make will think aoqi@0: this system has aoqi@0:
--with-msvcr-dll=path aoqi@0: select the msvcr100.dll aoqi@0: file to include in the aoqi@0: Windows builds (C/C++ runtime library for aoqi@0: Visual Studio). aoqi@0:
aoqi@0: This is usually picked up automatically aoqi@0: from the redist aoqi@0: directories of Visual Studio 2010. aoqi@0:
--with-num-cores=cores aoqi@0: select the number of cores to use (processor aoqi@0: count or CPU count) aoqi@0:
--with-x=path aoqi@0: select the location of the X11 and xrender files. aoqi@0:
aoqi@0: The aoqi@0: XRender Extension Headers aoqi@0: are required for building the aoqi@0: OpenJDK on Solaris and Linux. aoqi@0:
aoqi@0: The Linux header files are usually available from a "Xrender" aoqi@0: development package, it's recommended that you try and use aoqi@0: the package provided by the particular distribution of Linux that aoqi@0: you are using. aoqi@0:
aoqi@0: The Solaris XRender header files is aoqi@0: included with the other X11 header files aoqi@0: in the package SFWxwinc aoqi@0: on new enough versions of aoqi@0: Solaris and will be installed in aoqi@0: /usr/X11/include/X11/extensions/Xrender.h or aoqi@0: /usr/openwin/share/include/X11/extensions/Xrender.h aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Make

aoqi@0:
aoqi@0: The basic invocation of the make utility aoqi@0: looks like: aoqi@0:
aoqi@0: make all aoqi@0:
aoqi@0: This will start the build to the output directory containing the aoqi@0: "configuration" that was created by the configure aoqi@0: script. Run make help for more information on aoqi@0: the available targets. aoqi@0:
aoqi@0: There are some of the make targets that aoqi@0: are of general interest: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
Make TargetDescription
emptybuild everything but no images
allbuild everything including images
all-confbuild all configurations
imagescreate complete j2sdk and j2re images
installinstall the generated images locally, aoqi@0: typically in /usr/local
cleanremove all files generated by make, aoqi@0: but not those generated by configure
dist-cleanremove all files generated by both aoqi@0: and configure (basically killing the configuration)
helpgive some help on using make, aoqi@0: including some interesting make targets
aoqi@0:
aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Testing

aoqi@0:
aoqi@0: When the build is completed, you should see the generated aoqi@0: binaries and associated files in the j2sdk-image aoqi@0: directory in the output directory. aoqi@0: In particular, the aoqi@0: build/*/images/j2sdk-image/bin aoqi@0: directory should contain executables for the aoqi@0: OpenJDK tools and utilities for that configuration. aoqi@0: The testing tool jtreg will be needed aoqi@0: and can be found at: aoqi@0: aoqi@0: the jtreg site. aoqi@0: The provided regression tests in the repositories aoqi@0: can be run with the command: aoqi@0:
aoqi@0: cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all aoqi@0:
aoqi@0:
aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Appendix A: Hints and Tips

aoqi@0:
aoqi@0: aoqi@0:

FAQ

aoqi@0:
aoqi@0: aoqi@0:

aoqi@0: Q: The generated-configure.sh file looks horrible! aoqi@0: How are you going to edit it? aoqi@0:
aoqi@0: A: The generated-configure.sh file is generated (think aoqi@0: "compiled") by the autoconf tools. The source code is aoqi@0: in configure.ac and various .m4 files in common/autoconf, aoqi@0: which are much more readable. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: Why is the generated-configure.sh file checked in, aoqi@0: if it is generated? aoqi@0:
aoqi@0: A: aoqi@0: If it was not generated, every user would need to have the autoconf aoqi@0: tools installed, and re-generate the configure file aoqi@0: as the first step. aoqi@0: Our goal is to minimize the work needed to be done by the user aoqi@0: to start building OpenJDK, and to minimize aoqi@0: the number of external dependencies required. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: Do you require a specific version of autoconf for regenerating aoqi@0: generated-configure.sh? aoqi@0:
aoqi@0: A: aoqi@0: Yes, version 2.69 is required and should be easy aoqi@0: enough to aquire on all supported operating aoqi@0: systems. The reason for this is to avoid aoqi@0: large spurious changes in generated-configure.sh. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: How do you regenerate generated-configure.sh aoqi@0: after making changes to the input files? aoqi@0:
aoqi@0: A: aoqi@0: Regnerating generated-configure.sh aoqi@0: should always be done using the aoqi@0: script common/autoconf/autogen.sh to aoqi@0: ensure that the correct files get updated. This aoqi@0: script should also be run after mercurial tries to aoqi@0: merge generated-configure.sh as a aoqi@0: merge of the generated file is not guaranteed to aoqi@0: be correct. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: What are the files in common/makefiles/support/* for? aoqi@0: They look like gibberish. aoqi@0:
aoqi@0: A: aoqi@0: They are a somewhat ugly hack to compensate for command line length aoqi@0: limitations on certain platforms (Windows, Solaris). aoqi@0: Due to a combination of limitations in make and the shell, aoqi@0: command lines containing too many files will not work properly. aoqi@0: These aoqi@0: helper files are part of an elaborate hack that will compress the aoqi@0: command line in the makefile and then uncompress it safely. aoqi@0: We're aoqi@0: not proud of it, but it does fix the problem. aoqi@0: If you have any better suggestions, we're all ears! :-) aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: I want to see the output of the commands that make runs, aoqi@0: like in the old build. How do I do that? aoqi@0:
aoqi@0: A: aoqi@0: You specify the LOG variable to make. There are aoqi@0: several log levels: aoqi@0:

aoqi@0:
aoqi@0:
    aoqi@0:
  • aoqi@0: warn — Default and very quiet. aoqi@0:
  • aoqi@0:
  • aoqi@0: info — Shows more progress information aoqi@0: than warn. aoqi@0:
  • aoqi@0:
  • aoqi@0: debug — Echos all command lines and aoqi@0: prints all macro calls for compilation definitions. aoqi@0:
  • aoqi@0:
  • aoqi@0: trace — Echos all $(shell) command aoqi@0: lines as well. aoqi@0:
  • aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: When do I have to re-run configure? aoqi@0:
aoqi@0: A: aoqi@0: Normally you will run configure only once for creating a aoqi@0: configuration. aoqi@0: You need to re-run configuration only if you want to change any aoqi@0: configuration options, aoqi@0: or if you pull down changes to the configure script. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: I have added a new source file. Do I need to modify the makefiles? aoqi@0:
aoqi@0: A: aoqi@0: Normally, no. If you want to create e.g. a new native aoqi@0: library, aoqi@0: you will need to modify the makefiles. But for normal file aoqi@0: additions or removals, no changes are needed. There are certan aoqi@0: exceptions for some native libraries where the source files are spread aoqi@0: over many directories which also contain sources for other aoqi@0: libraries. In these cases it was simply easier to create include lists aoqi@0: rather than excludes. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: When I run configure --help, I see many strange options, aoqi@0: like --dvidir. What is this? aoqi@0:
aoqi@0: A: aoqi@0: Configure provides a slew of options by default, to all projects aoqi@0: that use autoconf. Most of them are not used in OpenJDK, aoqi@0: so you can safely ignore them. To list only OpenJDK specific features, aoqi@0: use configure --help=short instead. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: configure provides OpenJDK-specific features such as aoqi@0: --with-builddeps-server that are not aoqi@0: described in this document. What about those? aoqi@0:
aoqi@0: A: aoqi@0: Try them out if you like! But be aware that most of these are aoqi@0: experimental features. aoqi@0: Many of them don't do anything at all at the moment; the option aoqi@0: is just a placeholder. Others depend on aoqi@0: pieces of code or infrastructure that is currently aoqi@0: not ready for prime time. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: How will you make sure you don't break anything? aoqi@0:
aoqi@0: A: aoqi@0: We have a script that compares the result of the new build system aoqi@0: with the result of the old. For most part, we aim for (and achieve) aoqi@0: byte-by-byte identical output. There are however technical issues aoqi@0: with e.g. native binaries, which might differ in a byte-by-byte aoqi@0: comparison, even aoqi@0: when building twice with the old build system. aoqi@0: For these, we compare relevant aspects aoqi@0: (e.g. the symbol table and file size). aoqi@0: Note that we still don't have 100% aoqi@0: equivalence, but we're close. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: I noticed this thing X in the build that looks very broken by design. aoqi@0: Why don't you fix it? aoqi@0:
aoqi@0: A: aoqi@0: Our goal is to produce a build output that is as close as aoqi@0: technically possible to the old build output. aoqi@0: If things were weird in the old build, aoqi@0: they will be weird in the new build. aoqi@0: Often, things were weird before due to obscurity, aoqi@0: but in the new build system the weird stuff comes up to the surface. aoqi@0: The plan is to attack these things at a later stage, aoqi@0: after the new build system is established. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: The code in the new build system is not that well-structured. aoqi@0: Will you fix this? aoqi@0:
aoqi@0: A: aoqi@0: Yes! The new build system has grown bit by bit as we converted aoqi@0: the old system. When all of the old build system is converted, aoqi@0: we can take a step back and clean up the structure of the new build aoqi@0: system. Some of this we plan to do before replacing the old build aoqi@0: system and some will need to wait until after. aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: Is anything able to use the results of the new build's default make target? aoqi@0:
aoqi@0: A: aoqi@0: Yes, this is the minimal (or roughly minimal) aoqi@0: set of compiled output needed for a developer to actually aoqi@0: execute the newly built JDK. The idea is that in an incremental aoqi@0: development fashion, when doing a normal make, aoqi@0: you should only spend time recompiling what's changed aoqi@0: (making it purely incremental) and only do the work that's aoqi@0: needed to actually run and test your code. aoqi@0: The packaging stuff that is part of the images aoqi@0: target is not needed for a normal developer who wants to aoqi@0: test his new code. Even if it's quite fast, it's still unnecessary. aoqi@0: We're targeting sub-second incremental rebuilds! ;-) aoqi@0: (Or, well, at least single-digit seconds...) aoqi@0:

aoqi@0: aoqi@0:

aoqi@0: Q: aoqi@0: I usually set a specific environment variable when building, aoqi@0: but I can't find the equivalent in the new build. aoqi@0: What should I do? aoqi@0:
aoqi@0: A: aoqi@0: It might very well be that we have neglected to add support for aoqi@0: an option that was actually used from outside the build system. aoqi@0: Email us and we will add support for it! aoqi@0:

aoqi@0: aoqi@0:
aoqi@0: aoqi@0:

Build Performance Tips

aoqi@0:
aoqi@0: aoqi@0:

Building OpenJDK requires a lot of horsepower. aoqi@0: Some of the build tools can be adjusted to utilize more or less aoqi@0: of resources such as aoqi@0: parallel threads and memory. aoqi@0: The configure script analyzes your system and selects reasonable aoqi@0: values for such options based on your hardware. aoqi@0: If you encounter resource problems, such as out of memory conditions, aoqi@0: you can modify the detected values with:

aoqi@0: aoqi@0: aoqi@0: aoqi@0:

It might also be necessary to specify the JVM arguments passed aoqi@0: to the Bootstrap JDK, using e.g. aoqi@0: --with-boot-jdk-jvmargs="-Xmx8G -enableassertions". aoqi@0: Doing this will override the default JVM arguments aoqi@0: passed to the Bootstrap JDK.

aoqi@0: aoqi@0: aoqi@0:

One of the top goals of the new build system is to improve the aoqi@0: build performance and decrease the time needed to build. This will aoqi@0: soon also apply to the java compilation when the Smart Javac wrapper aoqi@0: is making its way into jdk8. It can be tried in the build-infra aoqi@0: repository already. You are likely to find that the new build system aoqi@0: is faster than the old one even without this feature.

aoqi@0: aoqi@0:

At the end of a successful execution of configure, aoqi@0: you will get a performance summary, aoqi@0: indicating how well the build will perform. Here you will aoqi@0: also get performance hints. aoqi@0: If you want to build fast, pay attention to those!

aoqi@0: aoqi@0:

Building with ccache

aoqi@0: aoqi@0:

A simple way to radically speed up compilation of native code aoqi@0: (typically hotspot and native libraries in JDK) is to install aoqi@0: ccache. This will cache and reuse prior compilation results, if the aoqi@0: source code is unchanged. However, ccache versions prior to 3.1.4 aoqi@0: does not work correctly with the precompiled headers used in aoqi@0: OpenJDK. So if your platform supports ccache at 3.1.4 or later, we aoqi@0: highly recommend installing it. This is currently only supported on aoqi@0: linux.

aoqi@0: aoqi@0:

Building on local disk

aoqi@0: aoqi@0:

If you are using network shares, e.g. via NFS, for your source code, aoqi@0: make sure the build directory is situated on local disk. aoqi@0: The performance aoqi@0: penalty is extremely high for building on a network share, aoqi@0: close to unusable.

aoqi@0: aoqi@0:

Building only one JVM

aoqi@0: aoqi@0:

The old build builds multiple JVMs on 32-bit systems (client and aoqi@0: server; and on Windows kernel as well). In the new build we have aoqi@0: changed this default to only build server when it's available. This aoqi@0: improves build times for those not interested in multiple JVMs. To aoqi@0: mimic the old behavior on platforms that support it, aoqi@0: use --with-jvm-variants=client,server.

aoqi@0: aoqi@0:

Selecting the number of cores to build on

aoqi@0: aoqi@0:

By default, configure will analyze your machine and run the make aoqi@0: process in parallel with as many threads as you have cores. This aoqi@0: behavior can be overridden, either "permanently" (on a configure aoqi@0: basis) using --with-num-cores=N or for a single build aoqi@0: only (on a make basis), using make JOBS=N.

aoqi@0: aoqi@0:

If you want to make a slower build just this time, to save some CPU aoqi@0: power for other processes, you can run aoqi@0: e.g. make JOBS=2. This will force the makefiles aoqi@0: to only run 2 parallel processes, or even make JOBS=1 aoqi@0: which will disable parallelism.

aoqi@0: aoqi@0:

If you want to have it the other way round, namely having slow aoqi@0: builds default and override with fast if you're aoqi@0: impatient, you should call configure with aoqi@0: --with-num-cores=2, making 2 the default. aoqi@0: If you want to run with more aoqi@0: cores, run make JOBS=8

aoqi@0: aoqi@0:
aoqi@0: aoqi@0:

Troubleshooting

aoqi@0:
aoqi@0: aoqi@0:

Solving build problems

aoqi@0: aoqi@0:
aoqi@0: If the build fails (and it's not due to a compilation error in aoqi@0: a source file you've changed), the first thing you should do aoqi@0: is to re-run the build with more verbosity. aoqi@0: Do this by adding LOG=debug to your make command line. aoqi@0:
aoqi@0: The build log (with both stdout and stderr intermingled, aoqi@0: basically the same as you see on your console) can be found as aoqi@0: build.log in your build directory. aoqi@0:
aoqi@0: You can ask for help on build problems with the new build system aoqi@0: on either the aoqi@0: aoqi@0: build-dev aoqi@0: or the aoqi@0: aoqi@0: build-infra-dev aoqi@0: mailing lists. Please include the relevant parts aoqi@0: of the build log. aoqi@0:
aoqi@0: A build can fail for any number of reasons. aoqi@0: Most failures aoqi@0: are a result of trying to build in an environment in which all the aoqi@0: pre-build requirements have not been met. aoqi@0: The first step in aoqi@0: troubleshooting a build failure is to recheck that you have satisfied aoqi@0: all the pre-build requirements for your platform. aoqi@0: Scanning the configure log is a good first step, making aoqi@0: sure that what it found makes sense for your system. aoqi@0: Look for strange error messages or any difficulties that aoqi@0: configure had in finding things. aoqi@0:
aoqi@0: Some of the more common problems with builds are briefly aoqi@0: described aoqi@0: below, with suggestions for remedies. aoqi@0:
    aoqi@0:
  • aoqi@0: Corrupted Bundles on Windows: aoqi@0:
    aoqi@0: Some virus scanning software has been known to aoqi@0: corrupt the aoqi@0: downloading of zip bundles. aoqi@0: It may be necessary to disable the 'on access' or aoqi@0: 'real time' aoqi@0: virus scanning features to prevent this corruption. aoqi@0: This type of "real time" virus scanning can also aoqi@0: slow down the aoqi@0: build process significantly. aoqi@0: Temporarily disabling the feature, or excluding the build aoqi@0: output directory may be necessary to get correct and aoqi@0: faster builds. aoqi@0:
    aoqi@0:
  • aoqi@0:
  • aoqi@0: Slow Builds: aoqi@0:
    aoqi@0: If your build machine seems to be overloaded from too many aoqi@0: simultaneous C++ compiles, try setting the aoqi@0: JOBS=1 on the make command line. aoqi@0: Then try increasing the count slowly to an acceptable aoqi@0: level for your system. Also: aoqi@0:
    aoqi@0: Creating the javadocs can be very slow, aoqi@0: if you are running aoqi@0: javadoc, consider skipping that step. aoqi@0:
    aoqi@0: Faster CPUs, more RAM, and a faster DISK usually helps. aoqi@0: The VM build tends to be CPU intensive aoqi@0: (many C++ compiles), aoqi@0: and the rest of the JDK will often be disk intensive. aoqi@0:
    aoqi@0: Faster compiles are possible using a tool called aoqi@0: ccache. aoqi@0:
    aoqi@0:
    aoqi@0:
  • aoqi@0:
  • aoqi@0: File time issues: aoqi@0:
    aoqi@0: If you see warnings that refer to file time stamps, e.g. aoqi@0:
    aoqi@0: Warning message: aoqi@0: File `xxx' has modification time in aoqi@0: the future. aoqi@0:
    aoqi@0: Warning message: Clock skew detected. aoqi@0: Your build may aoqi@0: be incomplete. aoqi@0:
    aoqi@0: These warnings can occur when the clock on the build aoqi@0: machine is out of aoqi@0: sync with the timestamps on the source files. aoqi@0: Other errors, apparently aoqi@0: unrelated but in fact caused by the clock skew, aoqi@0: can occur along with aoqi@0: the clock skew warnings. aoqi@0: These secondary errors may tend to obscure the aoqi@0: fact that the true root cause of the problem aoqi@0: is an out-of-sync clock. aoqi@0:

    aoqi@0: If you see these warnings, reset the clock on the aoqi@0: build aoqi@0: machine, run "gmake clobber" aoqi@0: or delete the directory aoqi@0: containing the build output, and restart the aoqi@0: build from the beginning. aoqi@0:

    aoqi@0:
  • aoqi@0:
  • aoqi@0: Error message: aoqi@0: Trouble writing out table to disk aoqi@0:
    aoqi@0: Increase the amount of swap space on your build machine. aoqi@0: This could be caused by overloading the system and aoqi@0: it may be necessary to use: aoqi@0:
    aoqi@0: make JOBS=1 aoqi@0:
    aoqi@0: to reduce the load on the system. aoqi@0:
    aoqi@0:
  • aoqi@0:
  • aoqi@0: Error Message: aoqi@0: libstdc++ not found: aoqi@0:
    aoqi@0: This is caused by a missing libstdc++.a library. aoqi@0: This is installed as part of a specific package aoqi@0: (e.g. libstdc++.so.devel.386). aoqi@0: By default some 64-bit Linux versions (e.g. Fedora) aoqi@0: only install the 64-bit version of the libstdc++ package. aoqi@0: Various parts of the JDK build require a static aoqi@0: link of the C++ runtime libraries to allow for maximum aoqi@0: portability of the built images. aoqi@0:
    aoqi@0:
  • aoqi@0:
  • aoqi@0: Linux Error Message: aoqi@0: cannot restore segment prot after reloc aoqi@0:
    aoqi@0: This is probably an issue with SELinux (See aoqi@0: aoqi@0: http://en.wikipedia.org/wiki/SELinux). aoqi@0: Parts of the VM is built without the -fPIC for aoqi@0: performance reasons. aoqi@0:

    aoqi@0: To completely disable SELinux: aoqi@0:

      aoqi@0:
    1. $ su root
    2. aoqi@0:
    3. # system-config-securitylevel
    4. aoqi@0:
    5. In the window that appears, select the SELinux tab
    6. aoqi@0:
    7. Disable SELinux
    8. aoqi@0:
    aoqi@0:

    aoqi@0: Alternatively, instead of completely disabling it you could aoqi@0: disable just this one check. aoqi@0:

      aoqi@0:
    1. Select System->Administration->SELinux Management
    2. aoqi@0:
    3. In the SELinux Management Tool which appears, aoqi@0: select "Boolean" from the menu on the left
    4. aoqi@0:
    5. Expand the "Memory Protection" group
    6. aoqi@0:
    7. Check the first item, labeled aoqi@0: "Allow all unconfined executables to use aoqi@0: libraries requiring text relocation ..."
    8. aoqi@0:
    aoqi@0:
    aoqi@0:
  • aoqi@0:
  • aoqi@0: Windows Error Messages: aoqi@0:
    aoqi@0: *** fatal error - couldn't allocate heap, ... aoqi@0:
    aoqi@0: rm fails with "Directory not empty" aoqi@0:
    aoqi@0: unzip fails with "cannot create ... Permission denied" aoqi@0:
    aoqi@0: unzip fails with "cannot create ... Error 50" aoqi@0:
    aoqi@0:
    aoqi@0: The CYGWIN software can conflict with other non-CYGWIN aoqi@0: software. See the CYGWIN FAQ section on aoqi@0: aoqi@0: BLODA (applications that interfere with CYGWIN). aoqi@0:
    aoqi@0:
  • aoqi@0:
  • aoqi@0: Windows Error Message: spawn failed aoqi@0:
    aoqi@0: Try rebooting the system, or there could be some kind of aoqi@0: issue with the disk or disk partition being used. aoqi@0: Sometimes it comes with a "Permission Denied" message. aoqi@0:
    aoqi@0:
  • aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Appendix B: GNU make

aoqi@0:
aoqi@0: aoqi@0: The Makefiles in the OpenJDK are only valid when used with the aoqi@0: GNU version of the utility command make aoqi@0: (usually called gmake on Solaris). aoqi@0: A few notes about using GNU make: aoqi@0: aoqi@0:

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

aoqi@0: aoqi@0:

Building GNU make

aoqi@0:
aoqi@0: First step is to get the GNU make 3.81 or newer source from aoqi@0: aoqi@0: ftp.gnu.org/pub/gnu/make/. aoqi@0: Building is a little different depending on the OS but is aoqi@0: basically done with: aoqi@0:
aoqi@0: bash ./configure aoqi@0:
aoqi@0: make aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Appendix C: Build Environments

aoqi@0:
aoqi@0: aoqi@0:

Minimum Build Environments

aoqi@0:
aoqi@0: This file often describes specific requirements for what we aoqi@0: call the aoqi@0: "minimum build environments" (MBE) for this aoqi@0: specific release of the JDK. aoqi@0: What is listed below is what the Oracle Release aoqi@0: Engineering Team will use to build the Oracle JDK product. aoqi@0: Building with the MBE will hopefully generate the most compatible aoqi@0: bits that install on, and run correctly on, the most variations aoqi@0: of the same base OS and hardware architecture. aoqi@0: In some cases, these represent what is often called the aoqi@0: least common denominator, but each Operating System has different aoqi@0: aspects to it. aoqi@0:

aoqi@0: In all cases, the Bootstrap JDK version minimum is critical, aoqi@0: we cannot guarantee builds will work with older Bootstrap JDK's. aoqi@0: Also in all cases, more RAM and more processors is better, aoqi@0: the minimums listed below are simply recommendations. aoqi@0:

aoqi@0: With Solaris and Mac OS X, the version listed below is the aoqi@0: oldest release we can guarantee builds and works, and the aoqi@0: specific version of the compilers used could be critical. aoqi@0:

aoqi@0: With Windows the critical aspect is the Visual Studio compiler aoqi@0: used, which due to it's runtime, generally dictates what Windows aoqi@0: systems can do the builds and where the resulting bits can aoqi@0: be used.
aoqi@0: NOTE: We expect a change here off these older Windows OS releases aoqi@0: and to a 'less older' one, probably Windows 2008R2 X64. aoqi@0:

aoqi@0: With Linux, it was just a matter of picking a aoqi@0: stable distribution that is a good representative for Linux aoqi@0: in general.
aoqi@0: NOTE: We expect a change here from Fedora 9 to something else, aoqi@0: but it has not been completely determined yet, possibly aoqi@0: Ubuntu 12.04 X64, unbiased community feedback would be welcome on aoqi@0: what a good choice would be here. aoqi@0:

aoqi@0: It is understood that most developers will NOT be using these aoqi@0: specific versions, and in fact creating these specific versions aoqi@0: may be difficult due to the age of some of this software. aoqi@0: It is expected that developers are more often using the more aoqi@0: recent releases and distributions of these operating systems. aoqi@0:

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

aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
Base OS and ArchitectureOSC/C++ CompilerBootstrap JDKProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Fedora 9gcc 4.3 JDK 7u72 or more1 GB6 GB
Solaris SPARC (32-bit) and SPARCV9 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Solaris X86 (32-bit) and X64 (64-bit)Solaris 10 Update 6Studio 12 Update 1 + patchesJDK 7u74 or more4 GB8 GB
Windows X86 (32-bit)Windows XPMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2003 - Enterprise x64 EditionMicrosoft Visual Studio C++ 2010 Professional EditionJDK 7u72 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.7 "Lion"XCode 4.5.2 or newerJDK 7u72 or more4 GB6 GB
aoqi@0:
aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

Specific Developer Build Environments

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

aoqi@0: NOTE: The community can help out by updating aoqi@0: this part of the document. aoqi@0: aoqi@0: aoqi@0:

Fedora

aoqi@0:
aoqi@0: After installing the latest aoqi@0: Fedora aoqi@0: you need to install several build dependencies. aoqi@0: The simplest way to do it is to execute the aoqi@0: following commands as user root: aoqi@0:
aoqi@0: yum-builddep java-1.7.0-openjdk aoqi@0:
aoqi@0: yum install gcc gcc-c++ aoqi@0:
aoqi@0:

aoqi@0: In addition, it's necessary to set a few environment aoqi@0: variables for the build: aoqi@0:

aoqi@0: export LANG=C aoqi@0:
aoqi@0: export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}" aoqi@0:
aoqi@0:
aoqi@0: aoqi@0: aoqi@0:

CentOS 5.5

aoqi@0:
aoqi@0: After installing aoqi@0: CentOS 5.5 aoqi@0: you need to make sure you have aoqi@0: the following Development bundles installed: aoqi@0:
aoqi@0:
    aoqi@0:
  • Development Libraries
  • aoqi@0:
  • Development Tools
  • aoqi@0:
  • Java Development
  • aoqi@0:
  • X Software Development (Including XFree86-devel)
  • aoqi@0:
aoqi@0:
aoqi@0:

aoqi@0: Plus the following packages: aoqi@0:

aoqi@0:
    aoqi@0:
  • cups devel: Cups Development Package
  • aoqi@0:
  • alsa devel: Alsa Development Package
  • aoqi@0:
  • Xi devel: libXi.so Development Package
  • aoqi@0:
aoqi@0:
aoqi@0:

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

aoqi@0: bash ./configure aoqi@0:
aoqi@0: make aoqi@0:
aoqi@0: sudo -u root make install aoqi@0:
aoqi@0:

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

aoqi@0: aoqi@0:

Debian 5.0 (Lenny)

aoqi@0:
aoqi@0: After installing Debian 5 aoqi@0: you need to install several build dependencies. aoqi@0: The simplest way to install the build dependencies is to aoqi@0: execute the following commands as user root: aoqi@0:
aoqi@0: aptitude build-dep openjdk-7 aoqi@0:
aoqi@0: aptitude install openjdk-7-jdk libmotif-dev aoqi@0:
aoqi@0:

aoqi@0: In addition, it's necessary to set a few environment aoqi@0: variables for the build: aoqi@0:

aoqi@0: export LANG=C aoqi@0:
aoqi@0: export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}" aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:

Ubuntu 12.04

aoqi@0:
aoqi@0: After installing Ubuntu 12.04 aoqi@0: you need to install several build dependencies. The simplest aoqi@0: way to do it is to execute the following commands: aoqi@0:
aoqi@0: sudo aptitude build-dep openjdk-7 aoqi@0:
aoqi@0: sudo aptitude install openjdk-7-jdk aoqi@0:
aoqi@0:

aoqi@0: In addition, it's necessary to set a few environment aoqi@0: variables for the build: aoqi@0:

aoqi@0: export LANG=C aoqi@0:
aoqi@0: export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}" aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:

OpenSUSE 11.1

aoqi@0:
aoqi@0: After installing OpenSUSE 11.1 aoqi@0: you need to install several build dependencies. aoqi@0: The simplest way to install the build dependencies is to aoqi@0: execute the following commands: aoqi@0:
aoqi@0: sudo zypper source-install -d java-1_7_0-openjdk aoqi@0:
aoqi@0: sudo zypper install make aoqi@0:
aoqi@0:

aoqi@0: In addition, it is necessary to set a few environment aoqi@0: variables for the build: aoqi@0:

aoqi@0: export LANG=C aoqi@0:
aoqi@0: export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}" aoqi@0:
aoqi@0:

aoqi@0: Finally, you need to unset the JAVA_HOME aoqi@0: environment variable: aoqi@0:

aoqi@0: export -n JAVA_HOME aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:

Mandriva Linux One 2009 Spring

aoqi@0:
aoqi@0: After installing Mandriva aoqi@0: Linux One 2009 Spring aoqi@0: you need to install several build dependencies. aoqi@0: The simplest way to install the build dependencies is to aoqi@0: execute the following commands as user root: aoqi@0:
aoqi@0: urpmi java-1.7.0-openjdk-devel make gcc gcc-c++ aoqi@0: freetype-devel zip unzip libcups2-devel libxrender1-devel aoqi@0: libalsa2-devel libstc++-static-devel libxtst6-devel aoqi@0: libxi-devel aoqi@0:
aoqi@0:

aoqi@0: In addition, it is necessary to set a few environment aoqi@0: variables for the build: aoqi@0:

aoqi@0: export LANG=C aoqi@0:
aoqi@0: export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}" aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:

OpenSolaris 2009.06

aoqi@0:
aoqi@0: After installing OpenSolaris 2009.06 aoqi@0: you need to install several build dependencies. aoqi@0: The simplest way to install the build dependencies is to aoqi@0: execute the following commands: aoqi@0:
aoqi@0: pfexec pkg install SUNWgmake SUNWj7dev aoqi@0: sunstudioexpress SUNWcups SUNWzip SUNWunzip SUNWxwhl aoqi@0: SUNWxorg-headers SUNWaudh SUNWfreetype2 aoqi@0:
aoqi@0:

aoqi@0: In addition, it is necessary to set a few environment aoqi@0: variables for the build: aoqi@0:

aoqi@0: export LANG=C aoqi@0:
aoqi@0: export PATH="/opt/SunStudioExpress/bin:${PATH}" aoqi@0:
aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0:
aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0: aoqi@0:
aoqi@0:

End of OpenJDK README-builds.html document.
Please come again! aoqi@0:


aoqi@0: aoqi@0: aoqi@0: