Microsoft
Software
Hardware
Network
Question : How to run java program from cron
I thought it would be just like anything else, but for some reason my java program returns a non-zero return code when run from cron. When run from command line it works fine.
This is my code that excutes the java program.
JAVADIR=/usr/java/jdk1.5.0
_06/bin
CLASSPATH=/test/hstaload:/
opt/jboss-
4.0.3SP1/s
erver/defa
ult/lib/po
stgresql-8
.1-404.jdb
c3.jar:/te
st/hstaloa
d/alturali
bCompile.j
ar:/test/h
staload/Hs
taLoad.jar
export CLASSPATH
export JAVADIR
$JAVADIR/java HstaLoadCeridianPay >>$JOBLOG
CONDCODE=$?
Answer : How to run java program from cron
What do you get in log file? Any information to why it failed? It has to be envirnment related. To make sure add your .profile/.bashrc/.cshrc (or whatever is your shell startup script) to this script. If the program works fine in cron it is env related.
. /home/user1/.profile
JAVADIR=/usr/java/jdk1.5.0
_06/bin
You could either leave the profile there in your script or add its content one by one until you find out which one makes your program run fine from cron.
Random Solutions
difference between RE-INDEXING and INDEX-DeFragging
push header, IP#?
How to use trusted connection: CR 8.5, VB6, SQL Server
Vista Network Drive - Application Not Found
Modify out of office assistant subject
in Bash's Sort, how do I sort by a second or third field ?
How do I get rid of Sync Issue folders in Outlook 2003?
Microsoft, Access, 2003, VBA, Make a record found in a recordset the current record of a form
CAST(MONTH(DDate) AS VarChar(20)) need two digits not one.
HTML Emails