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?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

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.
Here is this explanation of it though. It goes into much more detail.
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.

jar uf <class file name> <jar file name>

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

jar uf <jar file name> <class file name>
jbaird123Author Commented:
Thank you.
Thank you jbaird for the grade and the points.
Have a nice day.
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.