LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 03-28-2004, 06:16 AM   #1
tantric
LQ Newbie
 
Registered: Oct 2003
Location: Hampshire, UK
Distribution: SuSE 8.2 RH9
Posts: 20

Rep: Reputation: 0
JAVA_HOME path not set for all users


I need to set the JAVA_HOME enviroment variable for the wwwrun user. I am executing a script inside the htdocs directory (apaches xalan.sh/fop.sh), I can run xalan.sh and fop.sh from the command line, as my JAVA_HOME is set correctly.

My wwwrun user used to be able to run the xalan.sh with no problems, but now it is reporting that JAVA_HOME is not set correctly. I have no idea how to set the path for a user that never logs in (so I can't set it in the .profile file).

Does anyone have any ideas about this one?

I am tearing my hair out.

Thanks
 
Old 03-28-2004, 07:00 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Try adding
export JAVA_HOME=/path/to/java
to /etc/profile
If there is no file called profile in the /etc folder, try creating one in a text editor.
 
Old 03-29-2004, 03:30 AM   #3
tantric
LQ Newbie
 
Registered: Oct 2003
Location: Hampshire, UK
Distribution: SuSE 8.2 RH9
Posts: 20

Original Poster
Rep: Reputation: 0
Thumbs down



Oh well, that didn't work. I am close to tearing down the whole server and starting again! I just don't understand why it would stop working?!!?

Thanks for the suggestion
 
Old 03-29-2004, 05:00 AM   #4
MunterMan
Member
 
Registered: Nov 2003
Location: The North of England
Distribution: Suse 10.3
Posts: 172

Rep: Reputation: 30
In your /etc/profile.d directory there should be two files called jre*.sh and jre*.csh.
These are executed at start up and will set the environment for your jre.
If they don't exist, they are plain text and look like this
(NOTE: one has curly brackets and endif)

jre-latest.csh:
if ( ! $?JAVA_HOME ) then
setenv JAVA_HOME /usr/java/j2re1.4.2_01/jre
setenv PATH "${PATH}:${JAVA_HOME}/bin"
endif


jre-latest.sh:
if [ -z "$JAVA_HOME" ]; then
export JAVA_HOME=/usr/java/j2re1.4.2_01/jre
export PATH="$PATH:$JAVA_HOME/bin"
fi


Make sure the path is correct. The files you are looking for are binaries called java and java_vm and should be in /usr/java/j2re1.4.2_01/jre/bin
 
Old 03-29-2004, 06:05 AM   #5
tantric
LQ Newbie
 
Registered: Oct 2003
Location: Hampshire, UK
Distribution: SuSE 8.2 RH9
Posts: 20

Original Poster
Rep: Reputation: 0
I checked out those files and they all point correctly at where java resides on my system.

Everything is okay whilst Im logged in as root, I can run xalan.sh all day long, as soon as I used PHP to run it (wwwrun user). Xalan.sh reports back to me that JAVA_HOME is not correctly defined, very odd.

Mmm, maybe ill re-install Java, see what that does.


Thanks for the suggestions
 
Old 03-29-2004, 02:25 PM   #6
tantric
LQ Newbie
 
Registered: Oct 2003
Location: Hampshire, UK
Distribution: SuSE 8.2 RH9
Posts: 20

Original Poster
Rep: Reputation: 0
I re-installed Java, but no luck there.

In the end I manually adjusted the $JAVA_HOME variable in the xalan.sh and fop.sh, this is so strange as the whole thing worked for weeks without having to do this.

Heres hoping to it working for another 24 hours.

Thanks for all the suggestions

 
  


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
How to set JAVA_HOME in REDHAT 9.0 Linux? tejpatil Linux - Newbie 5 05-23-2004 02:17 PM
How to set JAVA_HOME in REDHAT 9.0 Linux? tejpatil Linux - General 1 05-23-2004 07:32 AM
Globally set PATH for all users glock19 Red Hat 8 11-09-2003 03:25 PM
PATH and JAVA_HOME peteABK Linux - Newbie 4 10-19-2003 05:30 PM
$JAVA_HOME and $PATH magnum818 Linux - Software 2 09-30-2003 11:05 PM


All times are GMT -5. The time now is 03:23 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration