[fedora-java] openjdk's rt.jar

Andrew John Hughes ahughes at redhat.com
Fri Nov 21 19:34:46 UTC 2008


Orion Poplawski wrote:
> Andrew Haley wrote:
>> Orion Poplawski wrote:
>>> -rw-r--r-- 1 root root 54M 2008-09-08 13:39
>>> ./java-1.6.0-openjdk-1.6.0.0/jre/lib/rt.jar
>>> -rw-r--r-- 1 root root 24M 2008-10-21 15:40
>>> ./java-1.6.0-sun-1.6.0.10/jre/lib/rt.jar
>>>
>>> Why so much bigger?
>>
>> I'd open them up and diff the trees.
>>
>> Andrew.
>>
> 
> I think it's compression level.  Here are the uncompressed sizes:
> 
> 167480  rt-sun
> 171788  rt-openjdk
> 
> [root at cynosure rt-sun]# dus
> 16      META-INF
> 48      sunw
> 7060    org
> 22396   java
> 30156   javax
> 38972   sun
> 68824   com
> 
> [root at cynosure rt-openjdk]# dus
> 16      META-INF
> 48      sunw
> 1336    net
> 7148    org
> 23576   java
> 31792   javax
> 39652   sun
> 68212   com
> 
> If I repack rt-openjdk: zip -r rt-openjdk.zip rt-openjdk
> 
> 27M 2008-11-21 11:55 rt-openjdk.zip
> 
> So, we're packing jars with minimal compression?  No, 
> /usr/lib/rpm/redhat/brp-java-repack-jars uses zip -9 and 
> java-1.6.0-openjdk turns off __jar_repack.
> 
> So, something in the openjdk build does it...
> 
> Looks like it's built with:
> 
> if ! test -d /builddir/build/BUILD/icedtea6-1.4/bootstrap/jdk1.6.0 ; \
>     then \
>       /usr/lib/jvm/java-openjdk/bin/jar cf 
> bootstrap/jdk1.7.0/jre/lib/rt-closed.jar -C lib/rt com -C lib/rt java \
>         -C lib/rt javax -C lib/rt netscape -C lib/rt net -C lib/rt sun ; \
>     else \
>       /builddir/build/BUILD/icedtea6-1.4/bootstrap/jdk1.6.0/bin/jar cf 
> bootstrap/jdk1.7.0/jre/lib/rt-closed.jar -C lib/rt com -C lib/rt java \
>         -C lib/rt javax -C lib/rt netscape -C lib/rt net -C lib/rt sun ; \
>     fi
> 
> So, does the "jar" command use compression?
> 

That's not building the final rt.jar.  That's just the faked binary 
plugs (which we don't actually need any more btw...)

The IcedTea build is basically done in two stages: an autoconf/automake 
IcedTea part which sets up the environment and then fires a second stage 
which runs the underlying OpenJDK makefiles.  For bootstrap builds, the 
OpenJDK make is run twice, the second time with the results of the first 
build as the build JDK.  rt.jar is built as part of Sun's OpenJDK make 
process.   The offending line is:

/builder/builds/icedtea/bootstrap/jdk1.6.0/bin/jar c0mf 
/builder/builds/icedtea/openjdk-ecj/build/linux-amd64/tmp/manifest.tmp 
/builder/builds/icedtea/openjdk-ecj/build/linux-amd64/tmp/rt-orig.jar \
	     `/bin/cat 
/builder/builds/icedtea/openjdk-ecj/build/linux-amd64/tmp/jarfilelists/rt_jar_list`)

I have no idea why 0 is being used to suppress compression, given this 
is presumably the same build process Sun uses for the proprietary JDK. 
I'll take a look.
--
Andrew :)




More information about the java-devel mailing list