Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6696329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:19:42+00:00 2026-05-26T06:19:42+00:00

I am searching for a .class file inside a bunch of jars. jar tf

  • 0

I am searching for a .class file inside a bunch of jars.

jar tf abc.jar 

works for one file. I tried

find -name "*.jar" | xargs jar tf

prints nothing. The only solution I can think of, is unzip all, then search. Is there a better way? I’m on LUnix.

Edit:
When scanning many jars, it is useful to print the jar file name along with the class. This method works well:

find . | grep jar$ | while read fname; do jar tf $fname | grep SchemaBuilder && echo $fname; done

Sample output produced:

  1572 Wed Jul 25 10:20:18 EDT 2007 org/apache/ws/commons/schema/SchemaBuilder$1.class
  1718 Wed Jul 25 10:20:18 EDT 2007 org/apache/ws/commons/schema/SchemaBuilder$2.class
 42607 Wed Jul 25 10:20:18 EDT 2007 org/apache/ws/commons/schema/SchemaBuilder.class
./XmlSchema-1.3.2.jar
  1572 Wed Jul 25 10:20:18 EDT 2007 org/apache/ws/commons/schema/SchemaBuilder$1.class
  1718 Wed Jul 25 10:20:18 EDT 2007 org/apache/ws/commons/schema/SchemaBuilder$2.class
 42607 Wed Jul 25 10:20:18 EDT 2007 org/apache/ws/commons/schema/SchemaBuilder.class
./XmlSchema.jar
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:19:43+00:00Added an answer on May 26, 2026 at 6:19 am

    You need to pass -n 1 to xargs to force it to run a separate jar command for each filename that it gets from find:

    find -name "*.jar" | xargs -n 1 jar tf
    

    Otherwise xargs‘s command line looks like jar tf file1.jar file2.jar..., which has a different meaning to what is intended.

    A useful debugging technique is to stick echo before the command to be run by xargs:

    find -name "*.jar" | xargs echo jar tf
    

    This would print out the full jar command instead of executing it, so that you can see what’s wrong with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file and searching mutiple value i.e I need to search {Name,Class}
I need to use the values from the property file... I tried searching it..
I'm searching for following issue i have. The class file names of our project
I'm trying to access a resource from the class path/JAR file as a File
im searching for a solution for my Haskell class. I have a list of
I'm searching for a DataGridView derrived class that show data in hierarchical way and
Searching for values that uses the same value Example SELECT Name, UnitPrice, Quantity, Color
Searching for possible ways to get cookie with httpOnly enabled, I cannot find any.
Searching from google.com, like www.abc.com Search Result Rank the pages like Title..... Description... www.abc.com
I am creating class instances by running a text file and slicing the words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.