You misunderstood me. I meant that allowing a program to download a library from the Internet at compile time or at runtime would pose a security threat. Chroot or no chroot, it could run loose and e.g. spam the wide world.
Sounds like a good idea. The only problem is the binary format of the submission; a little work must be done to adapt advanced features like viewing source by the user, etc.
You also have to take two things into account: 1) java has slow i/o as a language and as a result about 1/3 of the problems cannot be solved in it; 2) the submission size is limited by the problemsetter (as a rule to 50000 bytes); this would probably also have to apply to jar files. I think larger libraries should be preinstalled in the online judge on request.