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 [1]
    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 [2][3], Ubuntu 64-bit [4][5] and
    Windows [6][7] 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 [8].

 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 [9] 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 [10],
    Ubuntu 64-bit [11] or Windows [12], you're welcome to do so.

Andi..

[1] http://svn.osafoundation.org/chandler/trunk/external/openjdk/README
[2] 
http://builds.osafoundation.org/external/openjdk-7-ea-j2sdk-b21-Linux.tar.bz2
[3] http://builds.osafoundation.org/external/openjdk-7-ea-j2re-b21-Linux.tar.bz2
[4] 
http://builds.osafoundation.org/external/openjdk-7-ea-j2sdk-b23-Linux64.tar.bz2
[5] 
http://builds.osafoundation.org/external/openjdk-7-ea-j2re-b23-Linux64.tar.bz2
[6] 
http://builds.osafoundation.org/external/openjdk-7-ea-j2sdk-b21-Cygwin.tar.bz2
[7] 
http://builds.osafoundation.org/external/openjdk-7-ea-j2re-b21-Cygwin.tar.bz2
[8] http://svn.osafoundation.org/chandler/trunk/external/PyLucene/Makefile
[9] http://svn.osafoundation.org/chandler/trunk/external/openjdk/Makefile
[10] 
http://builds.osafoundation.org/external/linux/openjdk-7-ea-j2re-b21-3.tar.gz
[11] 
http://builds.osafoundation.org/external/linux/gutsy/x86_64/openjdk-7-ea-j2re-b23-3.tar.gz
[12] 
http://builds.osafoundation.org/external/windows/openjdk-7-ea-j2re-b21-3.tar.gz
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to