Trying to run java file in crontab


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Trying to run java file in crontab
# 1  
Old 04-05-2008
Trying to run java file in crontab

Hi.
I have a java program that create reports, and I would like to run it at each hour using crontab.
The main file is crome.jar located at /WebApps/Crome folder.
When I want to execute the program I use the next script (name crome):

Code:
#!/bin/sh
if [ -z ${CLASSPATH:=""} ] ; then
        CLASSPATH=/WebApps/Crome/crome.jar
else
        CLASSPATH=/WebApps/Crome/crome.jar:${CLASSPATH}
        fi
export CLASSPATH
exec /opt/progs/j2re1.4.2_11/bin/java -Dinstall.root=/WebApps/Crome/ -Xmx256m -Xms3m com.quantumsi.app.crome.CromeReportApp -local_root "/WebApps/Crome/local_root/crome/default" -install.root "/WebApps/Crome" -db_srvr REAL_MODE  "$@"

When I run the script manually it works perfectly but when I trying to running in crontab it doesn't, don't do anything.
My crontab file has the next:

Code:
# min(0-59)  hours(0-23) day(1-31) month(1-12) dow(0-7)   command
01 * * * * /WebApps/Crome/crome

What I am doing wrong????.
I will appreciate your help.

Thanks.

Last edited by Yogesh Sawant; 04-07-2008 at 05:09 AM.. Reason: added code tags
# 2  
Old 04-07-2008
have you tried searching here?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can't get my crontab to run

I'm trying to get a crontab to run, every Friday at 11am and the problem is that it isn't running at all. 0 11 * * 6 /Users/martinb/Documents/SYSADMIN/Regular-Scripts/Info-And-Backups.sh Here's a link to a screenshot of my script (I've censored my email address). Screen Shot 2017 11 03... (3 Replies)
Discussion started by: $shell_Learner
3 Replies

2. Shell Programming and Scripting

Log file is not updating when I run shell scripts scheduled thru crontab

Hi Forum, Good Day! I have created an empty html file wtih permissoin 777 created shell script(with permission 777) , code is below. #=======================start============== . /data09/oracle/apps_st/appl/D_oraapp095.env rm -rf /home/mnp/Test_log.txt echo... (1 Reply)
Discussion started by: kartheekbk
1 Replies

3. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

4. Shell Programming and Scripting

Cannot run this .java file from the home directory??

I wrote a simple test.java program in vi. I know it compiles correctly because I went into the directory where test.java was and compiled it and it created a java.class. I then ran test.java by staying in the same directory where it was and it worked great. However, when i backed out of the... (3 Replies)
Discussion started by: syregnar86
3 Replies

5. Linux

Run a php file using URL in crontab.

I want to run a php file from a url using cron tab. I am using a webhosting and i give a command like that 9 11 9 2 * wget -O /dev/null here-is-domain-name/cronfile.php but it does not work please tell me why this not work. I think this command must run a "cronfile.php" and i do not want to... (2 Replies)
Discussion started by: ArfanHaider
2 Replies

6. Shell Programming and Scripting

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... (3 Replies)
Discussion started by: MrCarter
3 Replies

7. Shell Programming and Scripting

Problem with java in crontab

Hello everybody, I have made a java program which runs when i do : java telemesures But when i want to put it in a cron i do /j2sdk1.4.1/bin/java -cp :/web/WEB-INF/classes/Dany4/ telemesures i have got Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver ... (2 Replies)
Discussion started by: totollix
2 Replies

8. Solaris

crontab to run every 20 second

Hi experts, I want to set the crontab for my script which will run every 20 seconds I think below could be the possible one- */3 * * * * /export/home/username/scripts/runing.sh As my system(SOLARIS 9) is live- i am confused to implement before make sure !!! I need... (4 Replies)
Discussion started by: thepurple
4 Replies

9. Shell Programming and Scripting

Run perl file in Crontab error.

Hi. I can run the script okay when I log in with root. Then I add this script to crontab and when crontab run i got this message error. I has installed DBD for Oracle already. I set ORACLE_HOME, ORACLE_BASE to root profile already. Please help me to fix it. It urgent. Thank so much. ... (2 Replies)
Discussion started by: raccsdl
2 Replies

10. UNIX for Dummies Questions & Answers

run a java file on UNIX?

HI, I want to run my .java file on a SunOS 5.8 Unix machine. The java file is writen with Ready to Program (Similar to Jbuilder) on a PC. Thanks!! (3 Replies)
Discussion started by: leotopia
3 Replies
Login or Register to Ask a Question