crontab - runninf a java script just isn't quite working...

hi gurus.

I have a little script that runs java from a certain directory. This script runs fine when run manually but when I try to schedule it, it fails to find the script.

little_script.sh..

/<directory of java>/java -classpath dsapi-6-5-3.jar:xerces.jar:ADLTools.jar:jdom.jar:activation.jar:mail.jar:bin <****.java file program>

the crontab entry..

17 15 * * * cd <dir of script>; little_script.sh

returned:-

/bin/sh: run.sh: command not found

Nearest I've got is where I..

the crontab entry..

24 15 * * * /<dir of script>/little_script.sh

returned:-

Exception in thread "main" java.lang.NoClassDefFoundError: <****.java file program> Caused by: java.lang.ClassNotFoundException: <****.java file program>
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: <****.java file program>.  Program will exit.

Could anybody suggest anything please?

manythanks.

MrC.

The environment, including CLASSPATH and PATH has to be defined. It is not by default. You have to be sure your environment is the same in cron as it is for you on the command line.

OK, thanks for ther update Tom but does it matter that the CLASSPATH is mentioned in the actual script I am running too?

actual script reads..

cat <littlescript>.sh
/xxxxxx/xxx/jdk1.6.0/bin/java -classpath dsapi-6-5-3.jar:xerces.jar:ADLTools.jar:jdom.jar:activation.jar:mail.jar:bin <code java file>

when I do this..

echo $CLASSPATH

..A blank response is returned - will I need to set the CLASSPATH during runtime..?

C

bump..

If I echo $PATH I get details, but echo-ing $SCREENPATH or $CLASSPATH returns a blank.

As I get this error message - it must be related..

'/<file structure>/<little script>.sh: line 1: ../jdk1.6.0/bin/java: No such file or directory'

bump..