using shell scripts-java

hi frnds,i need to call the java program from the shellscript using 'crontab' in linux.crontab is the utility in linux is to invoke the shellscript at every hour,every day or every month... Iam using the shell script to call the java program...then iam schedule that shell program in crontab based on hourly basis... but the crontab doesnt invoke the java program....

But if i call the shell script directly that java program executes.......I want to know how to invoke the java program using shell script in crontab...

[534 byte] By [83Krisha] at [2007-11-27 6:12:41]
# 1
Since running using crontab does not use any of the shell startup scripts such as bashrc, in your script you will need to explicitly define ALL the required environment variables including the PATH and CLASSPATH.
sabre150a at 2007-7-12 17:20:09 > top of Java-index,Java Essentials,Java Programming...
# 2
or just source your existing profile... such as (for ksh on unix)(. $HOME/.profile; $HOME/scripts/job.ksh)
corlettka at 2007-7-12 17:20:09 > top of Java-index,Java Essentials,Java Programming...
# 3
> or just source your existing profile... such as (for> ksh on unix)> (. $HOME/.profile; $HOME/scripts/job.ksh)Of course you will have to provide the $HOME path since, being an environment variable, it will not be defined.
sabre150a at 2007-7-12 17:20:09 > top of Java-index,Java Essentials,Java Programming...
# 4
Oops :-)
corlettka at 2007-7-12 17:20:09 > top of Java-index,Java Essentials,Java Programming...
# 5
> Of course you will have to provide the $HOME path since, > being an environment variable, it will not be defined.Crontab runs the jobs indeed in a very meager environment without first executing profile, but I think $HOME is set. Profile is usually found there
BIJ001a at 2007-7-12 17:20:09 > top of Java-index,Java Essentials,Java Programming...
# 6

http://www.adminschoice.com/docs/crontab.htm

Crontab Environment

__

cron invokes the command from the user's HOME directory with the shell, (/usr/bin/sh).

cron supplies a default environment for every shell, defining:

HOME=user's-home-directory

LOGNAME=user's-login-id

PATH=/usr/bin:/usr/sbin:.

SHELL=/usr/bin/sh

BIJ001a at 2007-7-12 17:20:09 > top of Java-index,Java Essentials,Java Programming...
# 7
Isn't it a question of linux system? not a java question at all. :)
Wuxi7227a at 2007-7-12 17:20:09 > top of Java-index,Java Essentials,Java Programming...
# 8
> Isn't it a question of linux system? Yes it is. http://forum.java.sun.com/thread.jspa?threadID=5190992
BIJ001a at 2007-7-12 17:20:09 > top of Java-index,Java Essentials,Java Programming...