Since there are no obvious restrictions on the placement of inner classes, you should try to process all possible (or as much as possible) places.
First of all, you should definitely look for java in PATH. Unfortunately, it sometimes fails, for example, you can often find java.exe in C:\Windows\System32 . Fortunately, in the case of Windows, you can use the registry to get a list of installed JREs.
If you find several jars that may contain base classes, you can use zip or jar to check for java/lang/Object.class .
source share