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