samedi 2 mai 2015

Iterating through all JDK classes

I'm making a code editor and I'm working on the autocomplete. I want to programmatically get a list of all the classes that come with the JDK.

Examples include:

java.io.File
java.util.ArrayList
javax.swing.Action

I've found ways to get classes for a specific package. For instance, I can get all classes that start with com.mypackage.foo. The problem is that I'm trying to get classes that were loaded with the Bootstrap ClassLoader. And on the OSX JDK, that classloader shows up as null. For instance, if I do String.class.getClassLoader(), that is null.

Any ideas?





Aucun commentaire:

Enregistrer un commentaire