wood burning stoves 2.0*
The moose likes Java in General and the fly likes package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "package" Watch "package" New topic
Author

package

kelly tyler
Greenhorn

Joined: Dec 24, 2002
Posts: 1
helo all
after writing a programe and putting it in a package how do u get that programe from the pc u worked with and run it on another pc?
pls help me out
i am having problems with it
kelly
karl koch
Ranch Hand

Joined: May 25, 2001
Posts: 388
hi
you can put all the classes in a jar file:
on the command line change to the base directory of your classes (but not in the package structure)
ant type:

this will add all files in the jar named NewJar.jar.
then copy this jar file to the other machine and start the app. On the command line:

where MainClass is the class with the main function. If you use packages then use the fully qualified name.
hope this helps (and hopefully the commands are correct. cant try them out here)
karl
khella smith
Ranch Hand

Joined: May 06, 2002
Posts: 39
thanks karl and is this command line that of ms dos?
it will help to know
i appreciate it
thanks
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
hi khella
yes. karl gave command line in MS DOS format. you see that '%' and ';' signs specific to MS DOS Format?
if it were unix then it would have been,
java -cp $CLASSPATH:NewJar.jar MainClass
regards
maulin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: package