How can I get all jars name used by my application?
Based on the bellow image, I would like an array that contains all jar file names, something like this:
myArray = ["log4j-1.2.17.jar","commons-io-2.4.jar","zip4j_1.3.2.jar"]
I have read this question, and try this:
String classpath = System.getProperty("java.class.path");
log.info(classpath);
List<String> entries = Arrays.asList(classpath.split(System.getProperty("path.separator")));
log.info("Entries " + entries);
But when I run the jar, I got this in my log file:
2015-07-10 17:41:23 INFO Updater:104 - C:\Prod\lib\Updater.jar
2015-07-10 17:41:23 INFO Updater:106 - Entries [C:\Prod\lib\Updater.jar]
Bellow the same question, one of the answers says I could use the Manifest class, but how do I do this?