Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-25-2009
Registered User
 

Join Date: Sep 2009
Posts: 2
Problem with java in crontab

Hello everybody, I have made a java program which runs when i do :
Code:
java telemesures

But when i want to put it in a cron i do
Code:
/j2sdk1.4.1/bin/java -cp :/web/WEB-INF/classes/Dany4/ telemesures

i have got
Code:
 Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver         at java.net.URLClassLoader$1.run(URLClassLoader.java:198)         at java.security.AccessController.doPrivileged(Native Method)         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)         at java.lang.Class.forName0(Native Method)         at java.lang.Class.forName(Class.java:140)         at telemesures.migration_telemesures(telemesures.java:26)         at telemesures.main(telemesures.java:66)

I don't know why it doesn't run when i do this command. It looks like the impoted packages are not imported... Thanks for help
Sponsored Links
  #2 (permalink)  
Old 09-25-2009
rdcwayx rdcwayx is offline Forum Advisor  
Registered User
 

Join Date: Jun 2006
Posts: 568
You need set CLASSPATH before run the java command,
such as:


Code:
export CLASSPATH=$CLASSPATH:ojdbc5.jar ; /j2sdk1.4.1/bin/java -cp :/web/WEB-INF/classes/Dany4/ telemesures

  #3 (permalink)  
Old 09-25-2009
Registered User
 

Join Date: Sep 2009
Posts: 2
ojdbc5.jar ? I don't know if i have it. I just import java.sql.*, java shouldn't know where is it ?

Code:
export CLASSPATH=$CLASSPATH:/web/WEB-INF/classes/oracle/jdbc/
/j2sdk1.4.1/bin/java -cp :/web/WEB-INF/classes/Dany4/ telemesures

Don't work ...
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab problem in AIX naveen.kuppili UNIX for Dummies Questions & Answers 8 05-22-2009 03:39 AM
Problem in crontab Ashok_oct22 Shell Programming and Scripting 9 01-23-2009 01:34 PM
Trying to run java file in crontab karmariv UNIX for Dummies Questions & Answers 1 04-07-2008 05:12 AM
Crontab Problem bullz26 Shell Programming and Scripting 9 03-16-2008 10:11 PM
crontab problem guest100 UNIX for Dummies Questions & Answers 19 03-31-2002 04:31 AM



All times are GMT -4. The time now is 05:45 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0