How would you determine the classes (non Sun JDK classes) loaded / unused by a Java application?
Background:
I have an legacy Java webstart application that has gone through a lot of code changes and now has a lot of classes, most of which are not used. I would like to reduce the download size of the application by only deploying classes that will be used only instead of jaring the all the packages.
I will also use the same process to completely delete these unused classes.
Use
java -verbose:classto see what classes are loaded, then use grep (or any other tool) to keep only the lines from your packages.A small limitation: it will only tell you which classes are really used when they are used, so you must cover all use cases of your application.