how to set classpath in cron


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to set classpath in cron
# 1  
Old 04-21-2008
how to set classpath in cron

i have written shell script that script has path to java programwhen irun this script in terminal i get the output but when irun in cron it gives me eror.plz send me code to set classpath

Code:
#! /bin/bash

javac  Copy.java

/usr/bin/java Copy

plz help me out
how should i write classpath java package taht i am using is
/usr/java/j2re1.6.0_05

this is where it is present


help

Last edited by Yogesh Sawant; 04-21-2008 at 06:29 AM.. Reason: added code tags
# 2  
Old 04-21-2008
Quote:
Originally Posted by sari
i have written shell script that script has path to java programwhen irun this script in terminal i get the output but when irun in cron it gives me eror.plz send me code to set classpath

Code:
#! /bin/bash

javac  Copy.java

/usr/bin/java Copy

plz help me out
how should i write classpath java package taht i am using is
/usr/java/j2re1.6.0_05

this is where it is present


help

Try adding the following line to your script ..

export CLASSPATH=$CLASSPATH:/usr/java/j2re1.6.0_05

rssrik
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Problems with set up Cron

Hi I want to set up a cron for every 15 minutes between some hours. Can you tell whether the below command will work. Getting confuse because my time goes from night to next day morning. i want to setup 8 PM to next day 10 AM. */15 20-10 * * * sh abc.sh (1 Reply)
Discussion started by: raju2016
1 Replies

2. Shell Programming and Scripting

Shell script to set trap for finding cron job failures

Unix box: solaris 5.8 Server: IP Need to to set trap for cron job failures by writing a shell script (5 Replies)
Discussion started by: ChandruBala73
5 Replies

3. UNIX for Dummies Questions & Answers

Set up CRON

Hello, I would like to set-up a script in cron on a Solaris 10 sever which would run once in 3 weeks. I am not supposed to make any changes in the script itself. Can anyone advise how it can be done? For any queries, kindly let me know. Thanks. (8 Replies)
Discussion started by: suddhasatwa_bha
8 Replies

4. Programming

set javac classpath

I have several jar files in a specific folder, but I can't get javac to understand it. How do I set the classpath for javac. It is NOT the same classpath as the java command. And it's not enough with one jar file. I have several. (1 Reply)
Discussion started by: locoroco
1 Replies

5. UNIX for Advanced & Expert Users

how to set jar classpath in unix

while running one script am gettng below error ERROR (class path) : /sbcimp/run/pkgs/MsgTechJavaUtils/1.4/lib/MsgTechUtils.jar does not exist. means need to set the class path in env i guess can someone suggest how to set this in redhat 5.3 ? (1 Reply)
Discussion started by: mail2sant
1 Replies

6. UNIX for Dummies Questions & Answers

Re : Set multiple cron jobs in one crontab file

Hello All, Hopw all is fine. I am newbie to Unix. I am using Bourne Shell (sh). One of the question I have is that I am trying to read XML file and based on reading that XML file I want to run different java programs at different hours. Meaning 05 14 * * * java ./program1 10 14 * * * java... (3 Replies)
Discussion started by: samshaw
3 Replies

7. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

8. Programming

Classpath

This question is realted to UNIX and Java. I sing in to a UNIX server and I want to change my CLASSPATH locally, so it won't affect any other users CLASSPATHS. Is the command 'export PATH=...' the way to do it? Thanks. (4 Replies)
Discussion started by: Rachel Ross
4 Replies

9. UNIX for Dummies Questions & Answers

Classpath

This question is realted to UNIX and Java. I sing in to a UNIX server and I want to change my CLASSPATH locally, so it won't affect any other users CLASSPATHS. Is the command 'export PATH=...' the way to do it? Thanks. Duplicate post (0 Replies)
Discussion started by: Rachel Ross
0 Replies

10. UNIX for Dummies Questions & Answers

set up cron permission in Sun

Under this directory: /var/spool/cron/crontabs/ I have the following users: adm lp oracle root sys uucp I believe who are able to start a cron job. I am trying to create a cronjob under user banjob so that it can delete files older than 30 days. How can I add user banjob... (4 Replies)
Discussion started by: simt
4 Replies
Login or Register to Ask a Question