null ClassLoader

Jeff Sturm jsturm@one-point.com
Fri Oct 26 07:24:00 GMT 2001


On Fri, 26 Oct 2001, Torsten R|ger wrote:
> I stumbled across a smaller annoyance: When you write 
> someObject.getClass().getClassLoader()  you get null back.

This has been discussed before...

> Now, I know it says in the spec: "some JVM implementations may return 
> null to signal the bootstrap ClassLoader", just in practise no other JVM 
> that I know does.

Do you know of any VM that doesn't print "null" with:

public class T {
  public static void main(String[] args) {
    System.out.println(Object.class.getClassLoader());
  }
}

I tried it with gcj, JDK 1.2.2 and JDK 1.3.0 with the same result.

Jeff



More information about the Java mailing list