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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-28-2004, 06:16 AM
|
#1
|
LQ Newbie
Registered: Oct 2003
Location: Hampshire, UK
Distribution: SuSE 8.2 RH9
Posts: 20
Rep:
|
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
|
|
|
03-28-2004, 07:00 AM
|
#2
|
Senior Member
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073
Rep:
|
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.
|
|
|
03-29-2004, 03:30 AM
|
#3
|
LQ Newbie
Registered: Oct 2003
Location: Hampshire, UK
Distribution: SuSE 8.2 RH9
Posts: 20
Original Poster
Rep:
|
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
|
|
|
03-29-2004, 05:00 AM
|
#4
|
Member
Registered: Nov 2003
Location: The North of England
Distribution: Suse 10.3
Posts: 172
Rep:
|
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
|
|
|
03-29-2004, 06:05 AM
|
#5
|
LQ Newbie
Registered: Oct 2003
Location: Hampshire, UK
Distribution: SuSE 8.2 RH9
Posts: 20
Original Poster
Rep:
|
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
|
|
|
03-29-2004, 02:25 PM
|
#6
|
LQ Newbie
Registered: Oct 2003
Location: Hampshire, UK
Distribution: SuSE 8.2 RH9
Posts: 20
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 01:08 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|