blob: 5fc8106a502b71acc55b4e4fcb90f397ad41fd0e [file] [log] [blame]
Mahmood Ali10353ed2009-07-06 15:18:44 -04001This file contains some notes about the process of building the full
Michael Ernst8bd6c612010-09-19 20:54:39 -07002OpenJDK distribution in RedHat Enterprise Linux 4 (Oracle's recommended
3environment) in VMWare. It also contains some of Matt's recommendations as
Mahmood Ali10353ed2009-07-06 15:18:44 -04004to when and how OpenJDK builds should be made.
5
6===========================================================================
7
8Notes on OpenJDK build process:
9
10Sun's "official" build environment (per /README-builds.html#MBE in the
11source distribution) is RHEL 4.
12
13Obtain RHEL 4 via MIT - IS&T offers it to students and faculty via
14https://web.mit.edu/rhlinux/rhel-4.0.
15
16There are three varieties of RHEL 4 - AS, ES, and WS. I used WS, which I
17believe is for workstations (the others are intended for servers). This
18requires downloading the WS disc 1 and the AS discs 2 - 4.
19
20A single disk of size 8.0 GB was created in VMWare; VMWare's option for
21using .iso files as optical drives was also used (i.e., didn't need to
22mount loopback on the host). In retrospect, perhaps a larger disk should be
23used, as only ~500 MB remains after the JDK build.
24
25Default options were chosen for RHEL setup (including automatic
26partitioning and default packages). In the future, SELinux should be
27disabled in the installer (it can also be done later, but this will save a
28step).
29
30It seems that RHEL 4 doesn't have yum for package management, and that the
31"up2date" command should be used instead. up2date doesn't seem to have some
32way to search packages, though, so I had to google for some of the package
33names below. Before using up2date, I registered with IS&T (not Red Hat!),
34which was basically just a certificate check and running a script that they
35provide.
36
37I acquired the following packages:
38- JDK 6 (Linux x86 RPM version; for bootstrapping) --
39 http://java.sun.com/javase/downloads/index.jsp
40- SVN -- "up2date subversion"
41- JDK 7 -- "svn checkout https://openjdk.dev.java.net/svn/openjdk/jdk/trunk
42 openjdk --username guest" (hit enter for blank password)
43- JDK 7 binary plugs -- http://download.java.net/openjdk/jdk7/
44- ALSA headers -- "up2date alsa-lib-devel"
45- CUPS headers -- "up2date cups-devel"
46
47I installed the JDK 6 package via "rpm -Uvh [package]", and then did
48"/usr/sbin/alternatives" (apparently the RedHat version of Debian's
49update-alternatives) to install "java" and "javac" links. JDK 7 was a
50simple checkout (though it took a while) and the binary plugs were a "java
51-jar [package]".
52
53
54I set the following environment variables (having checked out the JDK 7
55sources into my home directory):
56
57export ALT_BOOTDIR=/usr/java/jdk1.6.0_01
58export ALT_CLOSED_JDK_IMPORT_PATH=~/openjdk/binary-plugs/jdk1.7.0
59export LANG=C # to suppress a sanity check warning
60
61
62I then did the sanity check and build per the /README-build.html
63instructions. The sanity check took a second or two, and the full build
64took about 40 minutes.
65
66The /control/build/linux-i586 folder contains j2sdk-image, which seems
67suitable as a binary distribution. I don't think there's a way to create
Michael Ernst8bd6c612010-09-19 20:54:39 -070068the Oracle version, however (the .bin file that, when executed, prompts you to
Mahmood Ali10353ed2009-07-06 15:18:44 -040069accept their license and then extracts files).
70
71There also doesn't seem to be a way to extract out just the compiler
72sources. In binary form, the compiler is in j2sdk-image/lib/tools.jar.
73
74If "make" is run after a successful build (even if no changes have been
75made), it takes ~17 minutes to complete.
76
77===========================================================================
78
79Matt's Recommendations:
80
81The build procedure (in Linux, at least) should not prevent us from
82releasing a binary JSR 308 OpenJDK package. We may have to figure out how
Michael Ernst8bd6c612010-09-19 20:54:39 -070083to produce the Oracle package (with the license prompt and executable format)
Mahmood Ali10353ed2009-07-06 15:18:44 -040084if a .zip is not a sufficient means of distribution. We may need some
85additional tools and setup for building in Windows.
86
87However, the build procedure takes too long (at least 17 minutes per build,
88vs around 5 seconds for the current compiler-only setup) for doing
89day-to-day development in this environment. I propose continuing to work
Michael Ernst8bd6c612010-09-19 20:54:39 -070090with the compiler the way we have it in SVN (which mirrors Oracle's
Mahmood Ali10353ed2009-07-06 15:18:44 -040091compiler-only distribution) and creating two scripts: one for updating the
92OpenJDK checkout with our compiler modifications and one for updating our
93compiler repository with vendor OpenJDK changes. We'd only use the former
Michael Ernst8bd6c612010-09-19 20:54:39 -070094when doing a JSR 308 release, and only use the latter when Oracle does a
Mahmood Ali10353ed2009-07-06 15:18:44 -040095release. In this way, we don't have to make any serious modifications (only
96a couple of additions) to our repositories or build scripts and can keep
97small build times for daily development.