crontab error running exe jar

Arnold Cristobal

I'm trying to run a simple crontab scheduler using:

*/15 * * * * /usr/bin/java java -jar /tnpm/tnpm_pm_test.jar

But I'm getting this error:

Exception in thread "main" java.lang.NoClassDefFoundError: java
Caused by: java.lang.ClassNotFoundException: java
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: java. Program will exit.

I tried doing "whereis java" in my unix window and the java path is declared properly:

java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz

Anyone has any idea? is it privilege or user issue? or my crontab command is wwrong? or am I pointing it to the wrong java path? thanks...

EDIT:

in addition using "which java" points to /usr/bin/java and the complete path of my exe jar is under "/home/user1/tnpm/tnpm_pm_test.jar".

booboo

You should have java in your PATH, and you should find the dir of the java libs and put its path in your LD_LIBRARY_PATH. Hopefully that will help. I have seen /usr/bin/java -jar and not /usr/bin/java java -jar. You must also include the complete path for the jar file.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related