views:

84

answers:

2

I thought that gnu classpath was just an open source version of the Java library. Apparently it is tied heavily to the host system? Is this true.

For example, would it be possible to build a gnu classpath 'rt.jar' with only Java bytecode and what are the args to use that as the bootstrap library?

+1  A: 

The Java JRE for each platform is tied specifically to that platform and contains its own rt.jar file. The GNU classpath project was intended to create a free version of the Java class libraries, but that is now sort of a historical artifact since the Java implementation is now open source.

Greg Hewgill
+2  A: 

Most of GNU classpath is platform independent, but there is (and has to be) a VM specific layer that handles the behind-the-scenes interactions with the virtual machine and host operating system.

Classpath is not designed to be immediately usable by Java programmers. It requires an appropriate implementation of a number of Classpath VM* classes, etcetera. These classes are normally provided by the target VM's development team.

It should also be noted that some Open Source JVM projects that previously used Classpath are migrating to / have migrated to OpenJDK. One reason is that the Classpath implementation tended to be incompatible with the equivalent Sun JDKs. This is partly due to the 'clean-room' approach taken by the Class-path team (for legal reasons), and partly due to Sun's continuing unwillingness to license the JDK test suites to open source projects. (Apache Harmony has the latter problem too.)

Stephen C