Making OpenJDK builds easier
kelly.ohair at oracle.com
Wed Dec 1 11:04:59 PST 2010
Adding a CC to build-dev...
On Dec 1, 2010, at 8:21 AM, Erwin Vervaet wrote:
> Hello all,
> I'd like to bring up the topic of the ease of building the OpenJDK.
> Let me start with a bit of background. I attended an interesting
> OpenJDK talk by Dalibor at Devoxx 2010 earlier this month and
> decided I should check out the OpenJDK project. This of course meant
> grabbing the source code and building it!
> 1) Grabbing the code
> I immediately found info on how to install Mercurial and clone the
> Mercurial repo on openjdk.org. The Achilles heel here is of course
> the Forest extension. The main problem I had was finding Forest
> since the original Forest repo is no longer available (http://hg.akoha.org/hgforest/
> [Rant] This whole Forest deal feels a bit amateurish. Since Forest
> seems to be a discontinued project maybe the OpenJDK project should
> just grab control of it and let users download forest.py directly
> from openjdk.org itself? That would also allow the Forest
> installation instructions on openjdk.org to be simpler and more to
> the point [/Rant]
This forest extension has worked fine for many years, but with each
new Mercurial 1.+ release it tends to get broken.
I need to update the README-builds.html on this, I will file a CR so
it does not get forgotten.
The term forest probably came from the extension itself and it was
probably a mistake to use that term, water under the bridge.
What we really have with OpenJDK is a set of nested repositories, many
of which can be used independently. We in general like that
The forest extension, in my opinion, initially had a chance of
becoming a formal part of Mercurial when we started using it, but that
potential is gone now.
I myself would like to remove our dependence on the forest extension
completely and do something on the order of:
hg clone http://hg.openjdk.java.net/jdk7/jdk7 yourjdk7
cd yourjdk7 && make source
Where the top Makefile would populate the rest of your nested
repositories and potentially get the jaxp/jaxws sources too. That
The rest of the forest commands are nothing more than a traversal of
the repositories and repeating the same action on each, easily
scripted or make targets can be provided.
(I use 'makefile' loosely here, it's the functionality that is
important, an ant script might work too, but usually I know you have
> 2) Building the code
> Again I quickly found the "OpenJDK Build README" on openjdk.org (http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html
> ) and prepped my system for a build. Doing 'make sanity' told me
> everything was fine, so I tried 'make'. This runs into a problem
> because the build needs to download jaxp/jaxws/jaf code drops from
> the Internet and this is not allowed by default. After a bit of
> googling I issued a 'make ALLOW_DOWNLOADS=true' command. Next
> problem: the java.net download locations in the build system are
> fubar. After a bit more googling and investigation I patched two
> properties files (see attached patch) and now 'make
> ALLOW_DOWNLOADS=true' created my first OpenJDK 7 build!
> [Rant] That problem with the java.net download locations should
> obviously be fixed (maybe the attached patch can be my first OpenJDK
> contribution ;-) Secondly, the "OpenJDK Build README" should mention
> the ALLOW_DOWNLOADS flag, or maybe ALLOW_DOWNLOADS should even be
> "true" by default. [/Rant]
(What attached patch? But it doesn't matter, the links are being
changed with the changesets:
http://hg.openjdk.java.net/jdk7/build/jaxp/rev/d1cb3e473c32 and http://hg.openjdk.java.net/jdk7/build/jaxws/rev/f258bef45f3b
they just haven't been integrated into the master jdk7/jdk7 area
yet. The OpenJDK6 was fixed too.)
This ALLOW_DOWNLOADS was purposely defaulted to 'off' because in
general, when a build depends on web downloads, it's not as reliable a
I was also seeing a great deal of frustration when the download did
not work due to proxy issues or whatever.
The README-builds.html file should probably have made that clear, my
apologies. Another CR for me.
The java.net change was an unusual event and the older links should
have been forwarded from the get go, but were not.
It has been suggested multiple times that perhaps the jaxp and jaxws
repositories could just be deleted and the process
moved to the top level Makefile, where my above 'make source' idea
starts making even more sense.
> My 2c:
> The process of grabbing the source code and making your first
> OpenJDK should be as simple as possible. Making this super simple
> makes getting into OpenJDK hacking much more pleasant since you
> don't get bogged down in a bunch of stupid issues right from the
I can't agree with you more, but if these were the only issues you ran
into, I'm actually quite pleased.
Not saying they should have happened, and that they will be dealt
you should try building it on Windows, I suspect your Rants would be
RANTS and 'stupid' would be a bunch of 4 letter words. :^(
I'll try and see what I can do to address these issues.
> Erwin Vervaet
More information about the build-dev