Java

Linux Build Instructions

JavaTM 2 SDK, Standard Edition, v#VERSION# #MILESTONE#

Build Overview

Contents

Introduction

This README file contains build instructions for the JavaTM 2 SDK, Standard Edition, v#VERSION# (J2SDK #VERSION#) Community Source Release. Building the source code for the Java 2 SDK requires a high level of technical expertise. Sun provides the source code primarily for technical experts who want to conduct research, port the platform to new operating systems and hardware, or add enhancements that require access to platform internals. If you are not a technical professional in one of these categories, this release is probably not for you.

Linux System Setup

The official build platform for the 32-bit version of J2SDK #VERSION# is Red Hat Linux 6.1.

The minimum recommended hardware for building the Linux-i586 version is a Pentium class processor or better, at least 128 megabytes of RAM, and approximately 1.5 GB of free disk space.

64-BIT-ONLY: The official build platform for the 64-bit version of J2SDK #VERSION# is Red Hat Linux 7.2 - 64Bit Edition. The minimum recommended hardware for building the Linux-ia64 version is a Itanium class processor, at least 1 gigbyte of RAM, and approximately 4 GB of free disk space.

The build uses the tools contained in /bin and /usr/bin of a standard installation of the Linux operating environment. You should ensure that these directories are on your PATH.

Linux Build Tools and Libraries Setup

Once the Linux OS is set up, you will need to install additional tools and libraries for building the J2SDK.

GCC Compiler

The GNU gcc/g++ compiler version egcs-2.91.66 is required. This compiler is shipped with Red Hat Linux 6.1 in the /usr/bin directory.

64-BIT-ONLY: The GNU gcc/g++ compiler version 2.96 20000731 is required. This compiler is shipped with Red Hat Linux 7.2 64bit Edition in the /usr/bin directory.

If the compiler resides in a different directory on your machine, then set ALT_COMPILER_PATH to point to the location of the GCC compiler binaries. The GCC compiler binaries must also be in the PATH.

OJI Plug-in library Compiled with GCC 3.2 (32-bit build only)

To support Mozilla compiled with GCC 3.2 on Linux platform, we need to build the OJI Plug-in library using GNU gcc/g++ compiler version 3.2.

Case i: Using a single build system
In this case, both default GCC egcs 2.91.66 and GCC 3.2 are made to co-exist in the same build machine. Information on GCC 3.2, including download sites, is available on the GNU Gcc web site set ALT_GCC32_COMPILER_PATH to point to the location of GCC 3.2 binary.

Case ii: Using two build systems
In this case, you need to build the OJI Plug-in library with GCC 3.2 first before you start your primary linux-i586 build. You can build the OJI Plug-in library on another system where GCC 3.2 comes as the default compiler such as RH 8.0 or above. You can follow the guidelines below:

After successfully building the library, copy it to the primary build system and set ALT_GCC32_PLUGIN_LIB_PATH to point to the location of that library.

Bootstrap J2SDK

You will need access to a J2SDK 1.4.1 for Linux installation. The 1.4.1 binaries can be downloaded from Sun's J2SDK 1.4.1 download site. Set ALT_BOOTDIR to point to the location of the bootstrap J2SDK installation.

GNU Make

GNU make version 3.78.1 or later is required to build the J2SDK. Information on GNU make, including download sites, is available on the GNU Make web site. For convenience, place the GNU make binary in the PATH.

zip

The build requires zip version 2.2 (November 3rd 1997) or later. --> Set ALT_DEVTOOLS_PATH to point to the location of this binary. Information on zip, including download sites, is available on the info-zip web site.

Motif 2.1

Motif version 2.1 headers and libraries are required for building the Linux J2SDK. (Motif 2.2 headers will not work.)

As a convenience, the source bundles include an archive of motif workspace that incorporate a number of J2SDK-related bug fixes. Target gnumake scsl would automatically take care about building our motif workspace and generate motif headers and libraries and use them when it required in the build.

         +- $(OUTPUTDIR)/
            +- motif/           (Automatically ALT_MOTIF_DIR set to this directory.)
               +- include/
               +- lib/   
                

Mozilla Headers (32-bit build only)

Mozilla headers are required for building Java Plug-in. Download and unpack the headers into a directory similar to the one shown below, and set the ALT_MOZILLA_PATH environment variable to the absolute path of the top-level directory.
      +- devtools/          (set ALT_MOZILLA_PATH to this level)
         +- share/
            +- plugin/
               +- mozilla_headers_ns610/
    
The name of the top-level directory is not significant; it is not required to be named devtools.

cacerts

A certificates file named "cacerts" represents a system-wide keystore with CA certificates. In J2SDK and JRE binary bundles, the "cacerts" file contains root CA certificates from several public CAs (e.g., VeriSign, Thawte, and Baltimore).

The source bundles contain a cacerts file without CA root certificates. J2SDK builders will need to secure permission from each public CA and include the certficates into their own custom cacerts file. Failure to provide a populated cacerts file will result in verification of a certificat chain during runtime.

The ALT_CACERTS_FILE should be set to point to the location of the populated cacerts file.

ALSA (32-bit build only)

Advanced Linux Sound Architecture version 0.9.0rc5 or later is required for building the J2SE.

To install, download driver and library source tarballs from ALSA's homepage. As root, execute the following commands (you may need to adapt the version number):

      $ bunzip2 alsa-driver-0.9.0rc5.tar.bz2 alsa-lib-0.9.0rc5.tar.bz2
      $ tar xf alsa-driver-0.9.0rc5.tar
      $ cd alsa-driver-0.9.0rc5
      $ ./configure --with-cards=dummy          #no need of actual drivers
      $ make install
      $ cd ..
      $ tar xf alsa-lib-0.9.0rc5.tar
      $ cd alsa-lib-0.9.0rc5
      $ ./configure --target=i586-pc-linux-gnu  #should run on any Pentium
      $ make install
Should one of the above steps fail, refer to the documentation on ALSA's home page. Note that this is a minimum install that enables building the J2SE platform. To actually use ALSA sound drivers, more steps are necessary as outlined in the documentation on ALSA's homepage.
ALSA can be uninstalled by executing make uninstall first in the alsa-lib-0.9.0rc5 directory and then in alsa-driver-0.9.0rc5.

Alternatively, you can install pre-built ALSA rpm packages, for example from Fresh RPMs. Make sure that you do not link to a static library (libasound.a), by verifying that the dynamic library (libasound.so) is correctly installed in /usr/lib.

Linux Build Environment Variables

This section describes environment variables that you can set to influence various aspects of the build. Some of these variables are mentioned specifically in the setup and build instructions above. Others you may set at your discretion.

Environment variables may be set in the shell environment or on the GNU make command line.

PATH
Set the PATH to contain:
  • The location of the GNU make binary
  • The location of the GCC compiler binaries (usually /usr/bin, but see ALT_COMPILER_PATH)
  • /usr/bin
  • /bin

ALT_BOOTDIR
The location of the J2SDK 1.4.1 bootstrap installation.

ALT_OUTPUTDIR
An override for specifying the (absolute) path of where the build output is to go.

ALT_UNIXCOMMAND_PATH
An override for specifying where the Unix /bin commands are located. You usually do not need to set this variable: the default location is /bin.

ALT_USRBIN_PATH
An override for specifying where the Unix /usr/bin commands are located. You usually do not need to set this variable: the default location is /usr/bin)

ALT_COMPILER_PATH
An override for specifying the location of the GCC compiler. See GCC Compiler for details.

ALT_GCC32_COMPILER_PATH
An override for specifying the location of the GCC 3.2 compiler. See OJI Plug-in library Compiled with GCC 3.2 for details.

ALT_GCC32_PLUGIN_LIB_PATH
An override for specifying the location of the OJI Plug-in library compiled with GCC 3.2. See OJI Plug-in library Compiled with GCC 3.2 for details.

ALT_DEVTOOLS_PATH
The location of the gnumake binary. See gnumake for details.

ALT_CACERTS_FILE
The location of the cacerts file. See cacerts file for details.

ALT_MOTIF_DIR
The location of the Motif 2.1 headers and libraries. See Motif 2.1 for details.

ALT_MOZILLA_PATH
The location of the Mozilla headers. See Mozilla Headers for details.

MILESTONE
The milestone name for the build (e.g. "beta").

BUILD_NUMBER
The build number for the build (e.g. "b27").

Linux Build

  1. cd into the control/make directory.
  2. Start the build with the command:
        gnumake scsl [ALT_OUTPUTDIR=directory-name-for-output] [MILESTONE=milestone_name] [BUILD_NUMBER=build_number] [other "ALT_" overrides]

Copyright 2003 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

Sun