Find classes in Jar

I have a jar file and I want to know which of them are all classes. Can I do it?

+3
source share
2 answers

How about using jar

jar tf jar-file
  • The option tindicates what you want to view the JAR table of contents.
  • The parameter findicates that the JAR file whose contents you want to view is specified on the command line. Without the f option, the Jar tool will wait for the file name on stdin.
  • The argument jar-fileis the file name (or path and file name) of the JAR file whose contents you want to view.

and if you want to list only files .class, you can filter the result using greplike:

jar tf jar-file | grep '\.class$'
+2

jar - zip-. java.util.jar, jar , .class.

+2

Source: https://habr.com/ru/post/1763025/


All Articles