| Author |
running java file under jar
|
arjun rampal
Ranch Hand
Joined: Jul 08, 2005
Posts: 125
|
|
Hi I have a jar file which function like this It Takes the data file from the folder and insert it into database now again next day it takes the data file(new one) and delete old data and insert new data. There is file handle.java which is need to be invoked to do all these functions Now question- 1)only deploying jar file on server will work? 2)if yes How to invoke this file under jar usind java command? command because it is linux Regards
|
 |
Greg Charles
Bartender
Joined: Oct 01, 2001
Posts: 2542
|
|
Well, you will probably need to set a classpath, which should at least include your jar file and probably another jar that has the database driver. It's possible that other entries will also be needed. Once you get the classpath right, you should be able to invoke the class the same way you would if it were in a directory: java handle I assume handle.java (should be Handle.java, but I won't quibble) has a main method? Alternately, you can get fancy with the jar's manifest. This would allow you to invoke it as: java -jar yourjar.jar The Java command line tools work the same on Windows and Linux.
|
 |
 |
|
|
subject: running java file under jar
|
|
|