I was hoping some real professional would answer this, preferrably someone who has actually worked on a JVM/JDK. Since so far, none of them seem to be online (or have seen your question, for that matter), I will have a go at explaining this.
The Java Class Library classes (found in the rt.jar
file of your JRE/JDK) are in fact pure java. They do contain a lot of JNI calls, though. If you look at the source of FileInputStream
for example, you will find stuff like this:
private native int readBytes(byte b[], int off, int len)
throws IOException;
public int read(byte b[])
throws IOException
{
return readBytes(b, 0, b.length);
}
So your guess was correct: the JCL does make extensive use of JNI. But who provides those native implementations? Simple: The JVM. And that is how the pieces fit together.