Here's how I build a 32 bit OpenJDK (build 31) on my Ubuntu 8.04 (Hardy Heron) system.
1. Download
Download the following two files
- the source bundle,
- the binary plug which contains a small amount of the binary-only components
~/openjdk7-ws/openjdk-7-ea-src-b31-17_jul_2008.zipand the binary plugs
~/openjdk7-ws/jdk-7-ea-plug-b31-linux-i586-17_jul_2008.jar
2. Install required packages
Make sure that you install the following Ubuntu packages (I use the Synaptic Package Manger)
- ant
- ant-optional
- gawk
- gcc
- g++
- libasound2-dev
- libcupsys2-dev
- libfreetype6-dev
- libmotif-dev
- libx11proto-print-dev
- libxi-dev
- libxrender-dev
- libxt-dev
- libxext-dev
- libxtst-dev
- sun-java6-jdk
3. Unpack the source
Unzip the source bundle by typing
$ cd ~/openjdk7-wsand you will get the source directory
$ unzip openjdk-7-ea-src-b31-17_jul_2008.zip
~/openjdk7-ws/openjdk.
4. Unpack the binary plugs
Expand the binary plugs by typing
$ cd ~/openjdk7-wswhich invokes a Java GUI extractor. Accept the license and select ~/openjdk7-ws as the destination and you get the binary plugs directory
$ java -jar jdk-7-ea-plug-b31-linux-i586-17_jul_2008.jar
~/openjdk7-ws/openjdk-binary-plugs.
5. Suppress compiler warnings and errors
Edit the file
~/openjdk7-ws/openjdk/hotspot/make/linux/makefilesand add the following compiler option
CFLAGS += -Wno-write-stringsat the end of the list of the compiler options (line 60.)
And replace
#!/bin/shwith
#!/bin/bashin the first line of the six .sh files under
~/openjdk7-ws/openjdk/jdk/make/java/nio/and change the value of variable SH from sh to bash in line 121 of
~/openjdk7-ws/openjdk/jdk/make/common/shared/Defs-utils.gmk
6. Build
Start the build by typing the following
$ cd ~/openjdk7-wsand wait for a while and you will get the debug build in
$ unset JAVA_HOME
$ export ALT_BOOTDIR=/usr/lib/jvm/java-6-sun
$ export ALT_BINARY_PLUGS_PATH=~/openjdk7-ws/openjdk-binary-plugs
$ export LANG=C
$ make debug_build
$ ~/openjdk7-ws/openjdk/build/linux-i586-debug/j2sdk-imageTo build a product build, type
$ make product_buildand you will get the product build in
$ ~/openjdk7-ws/openjdk/build/linux-i586/j2sdk-imageTo clean the build directory, use
$ make clobber
No comments:
Post a Comment