- Download sources from http://jdk7.dev.java.net.
- Several additional ubuntu packages are required:
- apt-get install sun-java6-jdk libasound-dev libcupsys2-dev xutils-dev m4 libxt-dev x11proto-xext-dev libxext-dev libxtst-dev libxi-dev libxp-dev libxmu-dev
- Note: if it breaks because of a missing system header or lib, go to packages.ubuntu.com and search for the missing file to find out what package to install.
- I had to edit one Makefile to fix a compile error (will submit this patch to Sun).
- vi j2se/make/sun/jdbc/Makefile
- add -fPIC to the compile commands under the make_libs target (after $(CC))
- Copy resources from a previous JDK binary release because they aren't included with the source:
cd jdk1.7.0-b07/jre/lib
mkdir resources ; cd resources ; jar -xf ../resources.jar
( cd com/sun/java/swing/plaf/motif/icons/ ; cp *.gif ~/src/jdk/jdk7/trunk/j2se/src/share/classes/com/sun/java/swing/plaf/motif/icons )
( cd com/sun/java/swing/plaf/windows/icons ; cp *.gif ~/src/jdk/jdk7/trunk/j2se/src/share/classes/com/sun/java/swing/plaf/windows/icons )
( cd javax/swing/plaf/metal/icons ; cp *.gif ~/src/jdk/jdk7/trunk/j2se/src/share/classes/javax/swing/plaf/metal/icons )
( cd javax/swing/plaf/metal ; cp -r sounds ~/src/jdk/jdk7/trunk/j2se/src/share/classes/javax/swing/plaf/metal )
( cd ../lib ; cp -r audio ~/src/jdk/jdk7/trunk/j2se/src/share/lib ) - Create build-linux.sh script:
#!/bin/sh
export ALT_BOOTDIR=/usr/lib/jvm/java-6-sun
export ALT_DEVTOOLS_PATH=/usr/bin
export FULL_VERSION="$(basename $(pwd))-$(date +'%Y''%m''%d''.''%H''%M')"
export HOTSPOT_BUILD_JOBS=2
export PARALLEL_COMPILE_JOBS=2
cd control/make && /usr/bin/make MAKE_VERBOSE="" ECHO="echo" dev - time ./build-linux.sh
- Go get lunch
- If it works, you should have a jdk in control/build/linux-amd64 (or linux-i386 depending on your platform)
- Run bin/java -version:
java version "1.7.0"
Java(TM) SE Runtime Environment (1.7.0-internal-fastdebug-kellyc_06_mar_2007_22_32-b00-fastdebug)
Java HotSpot(TM) 64-Bit Server VM (build 1.7.0-internal-fastdebug-kellyc_06_mar_2007_22_32-b00-fastdebug, mixed mode)
Tuesday, March 06, 2007
Building JDK 7 from source on ubuntu feisty
Subscribe to:
Posts (Atom)