This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Help needed Packages and jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help needed Packages and jar" Watch "Help needed Packages and jar" New topic

Help needed Packages and jar

priya anantha

Joined: Jan 27, 2002
Posts: 5
Hi all,
I have created a package called newtest which has some classes. Now I have created jar file of all the classes in the package. Now how do I make use of the package in a different computer.
That is if I copy the jar file and if I want to make it available in my other computer.Should I have to create a maifest file
What should I do.
Where should I copy the jar file and how can I make use of the package in the java programs in the other computer.
Can any one help me.

Thanks,<br />Priya
Sean MacLean
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
Generally, you simply have to specify the jar's location in the classpath variable on the new system or pass the location to the application at start up.
i.e. (for windows) set CLASSPATH=%CLASSPATH%;c:\lib\newtest.jar
This assumes that you put the jar in a folder called c:\lib.
i.e. (windows).
java -classpath=%CLASSPATH%;c:\lib\newtest.jar
It is also common to create set-up scripts, etc that will do this automatically (i.e. .bat files)
Hope this helps.
I agree. Here's the link:
subject: Help needed Packages and jar
It's not a secret anymore!