Building OpenJDK 7 on Windows XP
Rob Ross
rob.ross at gmail.com
Mon May 19 11:27:39 UTC 2008
Hi there everyone.
This will officially be my first email to the OpenJDK project.
I got to attend a couple of sessions/BOFs at JavaOne2008 about
OpenJDK and my interest was piqued. I've been playing with the build
for the last week. (A more accurate description would be, "yanking my
hair out and cursing my computer quite often", but I supposed it's
part of the learning curve.)
I was finally able to get "make sanity" to pass this evening, and I
felt quite pleased with myself. However, I have no expectations that
this will actually build now - but I still consider this a milestone
victory.
Some of the difficulties I encountered were
1. Just assembling the prerequisite software
The jdk7/README-builds.html actually does a fairly good job of
listing everything needed. But I'm not a Windows developer, so
finding a copy of VS .Net 2003 was a little challenging. Luckily that
install process was pretty simple. The build generates a warning if
Ant and FindBugs aren't locatable; those were easy to install but
perhaps you should add these programs to the list of requirements in
the README. Cygwin was also pretty easy to install after spending a
little time reading up on it. Finding an earlier version of make
(gmake) was a little hard, but I see now there are links in the
mailing list archive so that would be useful to add a link to the
README as well. Some of the Categories/package names you gave for
the particular cygwin utilities needed may be out of date. Zip and
Unzip are found in the Archive category, not Utils as described in
the README. "Free" is listed as being in Utils but it's actually part
of the "procps" package, under the System category. And there isn't
an "awk" implementation, but there is a gawk. Freetype was the bane
of my existence for 3 days. I never could get the "stock" build
scripts to work with the version you stated was needed (2.3.0), and
what was available to be downloaded (2.3.5). I could not figure out
how to build it from source either via DOS/windows or cygwin. So I
ended up downloading the binary setup executable, which contained
freetype.lib, freetype6.dll, and zlib1.dll, and a freetype.dll.a that
was a red herring. I modified the Makefile for the freetypecheck tool
to change the name of the expected dll from "freetype.dll" to
"freetype6.dll", and added its dependent "zlib1.dll" to the copy
command. Not a very portable solution I know, but I just wanted to
get this thing to work! How is everyone else getting this to compile?
2. Mercurial - well, it's new, and a little more complicated than CVS/
SVN, but I think I'll get the hang of it. I fcloned from the jdk7
master forest, (using the forest extension) yesterday, so I have the
latest code (baring any changes in the last day). It will be a while
before I even have to worry about wanting to submit anything back
upstream, so I should be more comfortable with how it all works by then.
3. Setting up the ALT_* environment variables
The hardest part, and mostly trial-and-error, was determining what
variables needed to use the cygwin path syntax, and what needed to
use the normal Windows path syntax, and what needed to be
"shortcutted" by using the cygpath utility. This was mind numbingly
frustrating!!!! I found an email from Tim Bell that included his
sample script that was quite helpful in getting the right directories
from the VS .Net 2003 install into the PATH, LIB, and INCLUDE
variables, with the right syntax. As I was writing this email my
initial "gmake all" build failed, due to javac not being able to find
the binary plugins I had specified in ALT_BINARY_PLUGINS_PATH. It
seems THAT one needs to be a java IO file path! So now there are
THREE different path syntaxes in use in this script file :)
Anyway, I just wanted to share my experiences building the OpenJDK 7
on Windows.
Ironically, I'm only doing this to get some practice on the existing
build process. My ultimate goal is to port the OpenJDK 7 to Mac OS X,
as a full native app. I'm doing some preliminary analysis on the
existing code base to determine all calls to native methods, to get
a sense of the scope. For example, there are currently about 421
native method calls in the jdk/src/share classes. The Windows
implementation classes make 210 native calls, and the Solaris
implementation makes 299. But the first task would be to integrate
Mac OS build targets into the OpenJDK 7 project, so it can be built
on that platform. (Of course, it won't actually run without any
native implementation - that's step #2.) But I'll be making a more
formal presentation/declaration/request for sponsorship/ at a later
time.
Rob Ross
More information about the build-dev
mailing list