How to add a class to a .jar file

I have a Java program that has many .jar files.  I recently received two class files that need to be added to one of the .jar files.   How can I add these to a jar file?
jbaird123Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
calboronsterConnect With a Mentor Commented:
To make it very very simple..

rename the file to .zip
open and extract with winzip or any zip software (a folder structure will be extracted)
copy your file in the required folder location
zip the folder back to the same name as your jar and you are done.

Remember the folder structure after zipping should be exactly the same as before for things to work.
0
 
rawinnlnx9Commented:
0
 
rawinnlnx9Commented:
Here is this explanation of it though. It goes into much more detail.

http://www.lkn.ei.tum.de/arbeiten/faq/man/JAVA-tutorial/jar/basics/update.html
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
objectsCommented:
jar uf <class file name> <jar file name>

Make sure you include the class in its package/folder structure
0
 
objectsCommented:
oops, wrong way around. should be:


jar uf <jar file name> <class file name>
0
 
jbaird123Author Commented:
Thank you.
0
 
calboronsterCommented:
Thank you jbaird for the grade and the points.
Have a nice day.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.