LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-28-2006, 04:21 AM   #1
manu82
LQ Newbie
 
Registered: Dec 2005
Posts: 12

Rep: Reputation: 0
running java program through cron


Hi All,
i m trying to run a java program through cron but it is not running
while i tried to run java program through script ,it is working fine
i have already set the environment variable ,classpath for java
actually the script is wriiten in perl in which System("java Filename"); command is executed with the help of cron after every minute

the following are cron.txt file which i run
!/bin/bash
* * * * * path to java/java StreamingSolution

could anybody tell me what is the exact problem
Thanks & Regards,
Bhushan Verma

Last edited by manu82; 02-28-2006 at 11:06 PM.
 
Old 02-28-2006, 01:44 PM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
It maybe be having problems opening a display - try putting '-display :0.0' somewhere eg

* * * * * path to java/java StreamingSolution -display :0.0
 
Old 02-28-2006, 10:35 PM   #3
gerrybbs
LQ Newbie
 
Registered: Oct 2003
Posts: 2

Rep: Reputation: 0
You could need to reload the environment variable within your java script.

If your profile is ~/.bash_profile, which contained the classpath of java, to add these lines within your java script.

# Get the environment variable
if [ -f ~/.bash_profile ]; then
. ~/.bash_profile
fi



Quote:
Originally Posted by manu82
Hi All,
i m trying to run a java program through cron but it is not running
while i tried to run java program through script ,it is working fine
i have already set the environment variable ,classpath for java

the following are cron.txt file which i run
!/bin/bash
* * * * * path to java/java StreamingSolution

could anybody tell me what is the exact problem
Thanks & Regards,
Bhushan Verma
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop java program(threaded program..should end cleanly) rmanocha Programming 4 11-09-2004 09:36 AM
Running a Java Program from XWindows kilobravo Linux - General 4 01-16-2003 02:36 PM
Cron not running Half_Elf Linux - Software 4 01-10-2003 02:38 AM
Running Java Socket Program in a shell during bootup TomCruise2002 Linux - Newbie 1 10-15-2002 10:28 PM
Whats the best, free, program for writing and running Java oudent Programming 8 12-08-2001 06:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration