JarScan, scan all JAR files in all subfolders for

2019-02-03 13:57发布

We are seeing an older version of a class being used, although we had the latest one deploy. To scan all JAR files in all subfolders of an application server, how do we write a small shell script that prints out the file name of JARS files in which this specific class is found?

标签: java class jar
8条回答
混吃等死
2楼-- · 2019-02-03 14:22

You may also want to have a look at the Java tool JarScan.

One can search by class name and by package.

It helps a lot when Total Commander isn't available and only Java is allowed to execute.

查看更多
Anthone
3楼-- · 2019-02-03 14:28

Not directly answering your question, but maybe this will solve your problem: you can print out the location (e.g. the jar file) from which a specific class was loaded by adding a simple line to your code:

System.err.println(YourClass.class.getProtectionDomain().getCodeSource());

Then you will know for sure where it comes from.

查看更多
登录 后发表回答