Java Development using OpenJDK in the Resource-Aware Programming
Laboratory at Rice University 

Part of the Java-Mint Project


Ronald Garcia
January 28, 2009


The following is some accumulated information on OpenJDK as it
pertains to development work done by the Resource-Aware Programming
Lab (RAP).


As of the date of this text, the BSD port of the JDK, which is the
version being hacked to work with Mac OS X Leopard, has not been
merged with the main OpenJDK repository.  For now, versions of both
repositories are part of our svn, openjdk being the standard version,
which supports both Linux and Windows, and the bsd-port, which
supports Mac OS X.  



Notes on the Standard Repository
--------------------------------

The standard repository was acquired as a source tarball from
openjdk.java.net.  The file downloaded was:
http://www.java.net/download/openjdk/jdk7/promoted/b44/openjdk-7-ea-src-b44-22_jan_2009.zip


Notes on the BSD Repository
---------------------------

The BSD port of openjdk was acquired as a Mercurial Repository.  The
directions for getting and building it were found at:
http://landonf.bikemonkey.org/2008/08/20

Highlights:

- You need the latest copy of Apple Developer Tools (version 3.1.2 at
  this time)  to build openjdk under OS X.

- There are no source tarballs for the bsdports.  If you want a copy
  of the source other than the one in our svn repository, you need a
  recent version of Mercurial, 1.1 or later.  I used the Mac OS X
  install package for Mercurial 1.1.

- You need to install the Mercurial Forest Extension, which can only
  be downloaded as a Mercurial repository.  To install it, place the
  file forest.py in your /Library/Python/*/hgext directory and modify
  your ~/.hgrc as needed

- directions to getting the repository are found at the above URL


Building the Mac version
------------------------

The directions for building the mac version are at:
http://landonf.bikemonkey.org/2008/08/20

But a few notes to get you up to speed, details can be found at the
above site:

- The default Apple JDK *cannot* be used to build OpenJDK.  You must
download either an OpenJDK BSD binary or a copy of SoyLatte, the
predecessor project to the OpenJDK BSD port.
http://landonf.bikemonkey.org/static/soylatte/
(Follow the download directions)

- Not every piece of Sun JDK code is open source, so you need what are
  called "binary plugs" which fill in the gaps.  At this time, those
  plugs can be found as part of the IcedTea project.
http://landonf.bikemonkey.org/static/soylatte/jdk-7-icedtea-plugs-1.6b.tar.gz

- I found that I had to make some changes to the makefile line given
  by Landon Fuller.  My build line is as follows:

make \
ALT_BOOTDIR=/usr/local/soylatte16-i386-1.0.3 \
ALT_BINARY_PLUGS_PATH=/usr/local/lib/jdk-7-icedtea-plugs \
ALT_FREETYPE_HEADERS_PATH=/usr/X11R6/include \
ALT_FREETYPE_LIB_PATH=/usr/X11R6/lib \
ANT_HOME=/usr/share/ant \
NO_DOCS=true \
HOTSPOT_BUILD_JOBS=1 \
LC_ALL=C \
LANG=C 

The particular changes I made:
 - added "LANG=C" so as not to clash with Mercurial's need for LANG=utf8...
 - added "DEVTOOLS_PATH=/usr/bin" because it wasn't set right by default
 - changed ALT_BINARY_PLUGS_PATH to reflect where I installed it
 - changed ALT_BOOTDIR to point to the correct filename for soylatte


1/30/2009:

A conversation from August 2008 that portends difficulties that are
likely to come in creating a single portable OpenJDK repository:
http://osdir.com/ml/java.openjdk.general/2008-08/msg00018.html


2/10/2009 (emw4):
Build does not work on XCode 3.0. You must upgrade to XCode 3.1 (gcc build 5490)


3/11/2009 (emw4):
You can now compile just langtools, by going to the langtools dir and typing

ant -f make/build.xml

Then langtools/bin/javac will use the new compiler, and langtools/bin/java will
run the resulting class files.

NOTE: this assumes SoyLatte is installed at /usr/local/soylatte (use a symlink
if necessary).
