I want to set a cron job for my java code and I have tried this from project directory
java -classpath .:/home/project/lib/* pkg_name.my_code
and it works fine, however I dont know how to run it from any other directory[like in script] I have tried to add diroctry (having compiled classes) in classpath like this
java -classpath .:/home/project/lib/*;/home/project/pkg_name/* pkg_name.my_code
also tried
java -classpath ".:/home/project/lib/*;/home/project/pkg_name/*" pkg_name.my_code
but it gives error:
**Error: Could not find or load main class pkg_name.my_code **
can any please help me ?
.javafile?-classpath /home/project:/home/project/lib/someJar.jar:/home/project/lib/someOtherJar.jarmy_codein the packagepkg_name, the following should work:java -classpath /home/project:/home/project/lib/someJar.jar:/home/project/lib/someOtherJar.jar pkg_name.my_code