Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
Search or list Java classes in classpath (ncluding JARS) via command line

I really like the javap command line program to decompile and inspect classes however most of the time I can't recollect the fully qualified package name of a class:

javap java.nio.file.Files

If I don't know the package name then I resort to using Google. Is there a built-in java program or slick Linux command that could search and list all the matching packages of a given class name?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Searches all jars:

find <path> -name "*.jar" -exec jar -tf {} \; | grep "/<classname>\.class\$"

example:

find ~/.ivy2/ -name "*.jar" -exec jar -tf {} \; | grep "/Filter\.class\$"

output:

javax/servlet/Filter.class
javax/servlet/Filter.class
javax/servlet/Filter.class
org/scalatest/Filter.class
org/scalatest/Filter.class
org/fusesource/scalate/filter/Filter.class
org/fusesource/scalate/filter/Filter.class
scala/tools/scalap/scalax/rules/Filter.class
org/apache/ivy/util/filter/Filter.class
com/foursquare/fongo/impl/Filter.class
com/foursquare/fongo/impl/Filter.class
com/foursquare/fongo/impl/Filter.class
shapeless/Filter.class

I'm not personally in love with this solution.

To search all class files just use find:

find <path> -name "*.class"
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!