Honey, I built the JDK! (on Ubuntu)
As any mad scientist would do, just
to prove that it can be done, I decided to build Mustang on my shiny new
Ubuntu 6.06 "Dapper Drake" system. The build
instructions warn you not to try this at home. The official build
environment is Redhat Enterprise Advanced Server 2.1 update 2, formerly
known as Redhat Advanced Server 2.1 update 2. Ugh.
I was not sure that this was going to work. Ubuntu is Debian based, and it uses GCC 4.0, not GCC 3.2. As it turns out, the X11 headers have recently moved to around, so I had some grief. But it all turned out well, and I lived to tell the tale.
Why would anyone care? If you use Linux as your primary work OS (as I do), and you switched to the increasingly popular Ubuntu, and you want to tinker with the JDK, these instructions will save you time and frustration. (Not that much time, maybe. It took me less than a day to hack my way through.) For everyone else, it may be comforting to know that someone with very limited system programming experience can do the build in an unfamiliar environment. It certainly is a tribute to the Mustang team who put this very complex build together.
Here are the instructions.
- In addition to the basic GCC tools, you need the following packages
installed:
- ksh
- gawk
- m4
- libasound-dev
- libcupsys2-dev
- libx11-dev
- Install the binary Mustang distribution, e.g. in /home/me/jdk1.6.0
- You need a binary 1.5 distribution, e.g. in /home/me/jdk1.5.0
- Make directories for the source and the output, e.g. /home/me/mustangsrc and /home/me/mustangout
- Download and install the JARs
cd mustangsrc java -jar ../downloads/jdk-6-rc-src-b87-jrl-09_jun_2006.jar java -jar ../downloads/jdk-6-rc-bin-b87-jrl-09_jun_2006.jar java -jar ../downloads/jdk-6-rc-mozilla_headers-b87-unix-09_jun_2006.jar
- Set environment variables
unset JAVA_HOME export ALT_BOOTDIR=/home/me/jdk1.5.0 export ALT_DEVTOOLS_PATH=/usr/bin export ALT_GCC29_PLUGIN_LIB_PATH=/home/me/jdk1.6.0/jre/plugin/i386/ns7-gcc29 export ALT_MOZILLA_HEADERS_PATH=/home/me/mustangsrc/share/plugin/ export ALT_OUTPUTDIR=/home/me/mustangout export MILESTONE=rc export BUILD_NUMBER=b87
- In Ubuntu, basename is in /usr/bin, not in
/bin. In j2se/make/common/shared/Defs-utils.gmk, change the
definition of BASENAME to
BASENAME = $(UTILS_USR_BIN_PATH)basename
- To avoid the error execvp: cp: Too many levels of symbolic
links, make these changes:
- In hotspot/make/Makefile, change the definition of CP
from cp to /bin/cp:
CP=/bin/cp
- The file j2se/make/docs/Makefile has two cp that should be $(CP), in the tagletapidocs: target.
- In hotspot/make/Makefile, change the definition of CP
from cp to /bin/cp:
- GCC 4.0 is pickier than GCC 3.2. Therefore, we won't fail on
warnings. Comment this out in j2se/make/docs/Makefile:
# WARNINGS_ARE_ERRORS = -Werror
- GCC 4.0 complains when redefining an extern function as
static. Comment out the word static in these function
definitions:
- j2se/src/solaris/hpi/native_threads/src/interrupt_md.c:113: error: static declaration of ‘sigignore’ follows non-static declaration
- j2se/src/share/native/sun/awt/cmm/spsearch.c:1335: error: static declaration of ‘TestFileCB’ follows non-static declaration
- j2se/src/share/back/error_messages.c:42: error: static declaration of ‘vprint_message’ follows non-static declaration
- j2se/src/javaws/share/native/launchFile.c:66: error: static declaration of ‘iksSecureProperty’ follows non-static declaration
- j2se/src/javaws/share/native/xmlparser.c:53: error: static declaration of ‘RemoveNonAsciiUTF8FromBuffer’ follows non-static declaration
- j2se/src/solaris/native/sun/awt/awt_dnd.c:172: error: static declaration of ‘xerror_code’ follows non-static declaration
- In j2se/src/solaris/native/sun/awt/awt_motif21.c, comment out this
declaration:
/* extern XIC XmImGetXIC( Widget w, uint32_t input_policy, ArgList args, Cardinal num_args) ; */ - I fixed the error PIC register ‘%ebx’ clobbered in
‘asm’ in j2se/src/solaris/bin/java_md.c by commenting
out %ebx in the clobber declaration
"%eax", /* "%ebx", */ "%ecx", "%edx"
I'd like some expert to tell me if that is ok. - Ubuntu 6.06 has a different location for several X11 files. Make
these changes:
- In motif/lib/Xm/util/Makefile, change IRULESRC to
IRULESRC=/etc/X11/config/cf
- In j2se/make/sun/xawt/Makefile, change
/usr/X11R6/include/X11/extensions to
/usr/include/X11/extensions:
ifeq ($(PLATFORM), linux) CPPFLAGS += -I/usr/include/X11/extensions -I$(MOTIF_DIR)/include -I$(OPENWIN_HOME)/include endif
and in j2se/make/sun/awt/mawt.gmk, change /usr/X11R6/lib to /usr/lib (3x):LIBXT = /usr/lib/libXt.a LIBSM = /usr/lib/libSM.a LIBICE = /usr/lib/libICE.a
- In motif/lib/Xm/util/Makefile, change IRULESRC to
The build instructions told me to run make scsl, but then I got an error complaining about a missing jscheme/REPL. Following this advice, I picked up with make j2se, and voila, it worked.
It walks, it talks! cd /home/me/mustangout bin/java -jar demo/jfc/SwingSet2/SwingSet2.jar
- Login or register to post comments
- Printer-friendly version
- cayhorstmann's blog
- 2706 reads





