In your specific case, you could just just grab all the classes in a big list [1], and pick at random from them.
You don't need to do much to figure out the url from the names, so it's really only the list of names you need.
[1] http://docs.oracle.com/javase/7/docs/api/allclasses-frame.ht...