Solved

How to add a class to a .jar file

Posted on 2011-02-17
7
1,048 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:jbaird123
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 34920277
0
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 34920287
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
 
LVL 92

Expert Comment

by:objects
ID: 34920719
jar uf <class file name> <jar file name>

Make sure you include the class in its package/folder structure
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 92

Expert Comment

by:objects
ID: 34920727
oops, wrong way around. should be:


jar uf <jar file name> <class file name>
0
 
LVL 2

Accepted Solution

by:
calboronster earned 500 total points
ID: 34924945
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
 

Author Closing Comment

by:jbaird123
ID: 34960609
Thank you.
0
 
LVL 2

Expert Comment

by:calboronster
ID: 34960642
Thank you jbaird for the grade and the points.
Have a nice day.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
count8 challlenge 13 87
countAbc challenge 9 50
micro services vs rest web services 16 53
Error with Java/Cache JDBC Classpath 2 21
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now