• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help needed Packages and jar

 
priya anantha
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Sean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic