I am trying to determine which class inside the jar contains the main or provided method name (if possible).
I currently have the following code
public static void getFromJars(String pathToAppJar) throws IOException{ FileInputStream jar = new FileInputStream(pathToAppJar); ZipInputStream zipSteam = new ZipInputStream(jar); ZipEntry ze; while ((ze = zipSteam.getNextEntry()) != null) { System.out.println(ze.toString()); } zipSteam.close(); }
This will allow me to get packages and classes under these packages, but I don't know if it is even possible to get methods inside classes. In addition, I do not know if this approach is suitable for the case of several pkg inside the jar, since each package can have a class with the main one in it.
I would be grateful for any ideas.
source share