Solved

How to add a class to a .jar file

Posted on 2011-02-17
7
1,075 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Configure a Bean in an XML file 4 49
Java: The Public Class Main 4 46
ejb entity bean example 2 39
Html split(text) 2 32
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

696 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