Command "java temp" print Hello World. but when I try to run this command using crontab it does not work.
I am using this command in crontab
*/2 * * * * /usr/bin/java -cp /home/parth/javafile/ temp
I also tried this command
*/2 * * * * root (cd /home/parth/javafile/temp.class ; java temp)
and
*/2 * * * * root /usr/bin/java -cp /home/parth/javafile/ temp
But these commands also does not work.
I also tried to create script file .sh and put java command inside script and then run that script using crontab. but that one also does not work.
I think I am doing something wrong with command but I am not getting what it is exactly.