How to set up new enviroment variables permanently for all users?

Hi.I downloadad Apache Tomcat, and need to set enviromental variables for all users.I tryed setenv commad, but it is not found.for example # JAVA_HOME="/opt/jre1.6.0" Solaris remembers this variable only for one session and I need for all users permanently.
[300 byte] By [TheNetWalkera] at [2007-11-26 22:47:45]
# 1

> for example # JAVA_HOME="/opt/jre1.6.0" Solaris

A quick and dirty way to do this might be to edit the file, /etc/profile

To use your example, add a line similar to the following to /etc/profile :

JAVA_HOME="/opt/jre1.6.0"; export JAVA_HOME

You might want to spend a few minutes researching the user login process -- especially the sequence with which the various profile files are transversed.

-mel

meljra at 2007-7-10 12:06:53 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2

Thank you.

This file contains a script. Is there difference in putting that line in beginning or end of the file?

#ident"@(#)profile1.1901/03/13 SMI"/* SVr4.0 1.3*/

# The profile that all logins get before using their own .profile.

trap "" 2 3

export LOGNAME PATH

if [ "$TERM" = "" ]

then

if /bin/i386

then

TERM=sun-color

else

TERM=sun

fi

export TERM

fi

#Login and -su shells get /etc/profile services.

#-rsh is given its environment in its .profile.

case "$0" in

-sh | -ksh | -jsh | -bash)

if [ ! -f .hushlogin ]

then

/usr/sbin/quota

#Allow the user to break the Message-Of-The-Day only.

trap "trap '' 2" 2

/bin/cat -s /etc/motd

trap "" 2

/bin/mail -E

case $? in

0)

echo "You have new mail."

;;

2)

echo "You have mail."

;;

esac

fi

esac

umask 022

trap 2 3

# Intel Server Control - The following lines

# let the LRA daemon access the X server

if [ -f /usr/bin/X11/xhost -a -f //isc/lra ]

then

ttyname=`tty`

ttyname=`basename $ttyname`

ttykind=`tty | egrep "console|vt"`

whereami=`finger -s | grep $ttyname | cut -c61-`

if [ "$whereami" = "" -a "$ttykind" = "" ]

then

CURDIS=$DISPLAY

DISPLAY=unix:0.0

export DISPLAY

/usr/X/bin/xhost +unknown 2>/dev/null 1>/dev/null

DISPLAY=$CURDIS

fi

fi

TheNetWalkera at 2007-7-10 12:06:53 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3
I'd be inclined to put it at the end and be sure to preface your entry with a comment or two.Also, save a copy of /etc/profile (e.g. /etc/profile.v00 ) before you start making changes.-mel
meljra at 2007-7-10 12:06:53 > top of Java-index,Solaris Operating System,Solaris 10 Features...