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 8991765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:48:12+00:00 2026-06-15T22:48:12+00:00

I’ve edited this question, and now it is exactly what I did: I want

  • 0

I’ve edited this question, and now it is exactly what I did:

I want to create a .jar file from some .class files in the command line.

I worked on Eclipse, and created:

myProject project, and in it: myPackage package, and in it: myClass class.
Then I wrote in the command line:

jar -cfv myJar.jar  myPackage\myClass.class

And I got this:

added manifest
adding: myPackage/myClass.class(in = 745) (out= 473)(deflated 36%)

This really created the myJar.jar file in my current directory. Now, I wanted to check if the process was done successfully, so I extracted the class from the jar thus:

jar xfv myJar.jar

And I got this:

  created: META-INF/
 inflated: META-INF/MANIFEST.MF
 inflated: myPackage/myClass.class

And this created for me just the META-INF folder, with the MANIFEST.MF in it, but I don’t see any .class file here!!

It seems like something in the packing to jar process is incorrect.

Anybody has an idea??

Any answer is appreciated!

  • 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-06-15T22:48:13+00:00Added an answer on June 15, 2026 at 10:48 pm

    According to the output you gave, there is no myClass.class file in the directory where you execute

    jar -cf myJar.jar myClass.class
    

    So obviously, the command can’t add it to the jar: it doesn’t exist. If you want to add the myClass directory, recursively, to the jar file, then use

    jar -cf myJar.jar myClass
    

    EDIT:

    Just look at the output:

     inflated: myPackage/myClass.class
    

    The myClass.class file is there in the jar file. There is no problem at all.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Does anyone know how can I replace this 2 symbol below from the string
I have a bunch of posts stored in text files formatted in yaml/textile (from
i want to parse a xhtml file and display in UITableView. what is the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.