[pylucene-dev] Re: question about Windows binaries
vajda at osafoundation.org
Sun Feb 17 12:47:04 PST 2008
On Sun, 17 Feb 2008, Bill Janssen wrote:
>> That's part of the problem. The JRE is _huge_. I was able to trim down
>> OpenJDK's rt.jar file from around 50Mb to about 7Mb. Lucene is rather frugal
>> with its JRE code needs.
> Do you have a recipe for doing this that others might follow?
Yes, take a look at what I did for chandler. The following steps are for
Windows and Linux only. It makes no sense doing these for Mac OS X as Apple
helpfully installs Java on every Mac. Also, I don't think that OpenJDK has
been ported to Mac OS X yet.
1. Building OpenJDK binaries from sources
I did this twice and both times before the recent changes to using
Mercurial for their source code repository which have changed things
quite a bit. Keeping an eye on their build issues mailing list is
recommended if you want to build the current source snapshots.
For my notes on building OpenJDK on Windows and Linux, see 
Now, that being said, building OpenJDK isn't exactly easy.
If you prefer, and if they fit your platform, you can use the JDK and
JRE binaries I built for Ubuntu 32-bit , Ubuntu 64-bit  and
Windows  instead.
These builds are complete, untrimmed, builds that are used as follows.
2. Building PyLucene with OpenJDK
For that use the complete JDK builds I just linked to. What I did for
the Chandler build should be used as an example. The Chandler build
process does not change jcc's setup.py and the PyLucene Makefile.
Instead, it passes the correct values in via environment variables.
The Chandler's PyLucene module build Makefile is here .
3. Trimming the JRE for distribution
Java Lucene is rather frugal with its use of the Java Runtime code.
I was able to massively trim down the JRE's rt.jar, yet retain it
sufficiently functional for Lucene.
The Chandler openjdk module build Makefile at  takes the complete JRE
binaries and trims them down for delivery. Look for the long litany of
'rm -rf' statements for the recipes.
If you'd rather download the resulting tarballs for Ubuntu 32-bit ,
Ubuntu 64-bit  or Windows , you're welcome to do so.
More information about the pylucene-dev