• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Crontab to run java program ?

larva

Member
Hi,

I login as root and modify the /etc/crontab by executing 'crontab -e' command and add the following line to crontab :

0-59 16 * * * root /etc/local/j2sdk1.4.1/bin/java /home/FileOutput

where FileOutput is a java program in .class. If I run manually by typing 'java FileOutput', a file will be generated in he same directory.
I always receive email saying that NoClassFound. Please help !

regards,
Larva
 
Go read up on CLASSPATH (should be covered in the Java Tutorial).

You never give a literal file path to the JVM to specify the main class. In an example like this, I would write a small wrapper shell script to call your Java program. In fact, most Java programs are called by shell scripts since starting them manually is somewhat painful (compared to clicking on an .exe for example).
 
Back
Top