problem with setting Java environment variables in Linux

L

Leo

Dear All,

In root mode, I added following lines to /root/.bashrc

export JAVA_HOME=/opt/SUNWappserver
export CATALINA_HOME=/opt/tomcat

Later, I found that if I am not super user,
echo $JAVA_HOME returns blank.

Only in root mode,
echo $JAVA_HOME returns /opt/SUNWappserver

I thought anything in root is available to general users. Why is not
this time?

Thank you very much.
 
J

James Westby

Leo said:
Dear All,

In root mode, I added following lines to /root/.bashrc

export JAVA_HOME=/opt/SUNWappserver
export CATALINA_HOME=/opt/tomcat

Later, I found that if I am not super user,
echo $JAVA_HOME returns blank.

Only in root mode,
echo $JAVA_HOME returns /opt/SUNWappserver

I thought anything in root is available to general users. Why is not
this time?

That's not true. This is the correct behaviour (on my distro at least).


James
 
G

Gordon Beaton

In root mode, I added following lines to /root/.bashrc
[...]

I thought anything in root is available to general users. Why is not
this time?

If you have questions about Linux or bash, there are more appropriate
groups than this one, which is about programming in Java.

That said, root is a user (much) like any other, so changes to root's
login files affect root only. If you want to change everyone's
environment, look for appropriate files in /etc.

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top