set environment variable in solaris 10
how do i set JAVA_HOME variable in solaris 10. when i try to run apache/tomcat/startup.sh it says JAVA_HOME environment variable not set.
That heavily depends on your shell. Usually you'd use something like "JAVA_HOME=<path" after which you can use the "export JAVA_HOME" command to make this variable available in processes you start from there on. To make this permanent you'd have to edit /etc/profile or a profile file in your home directory.
That heavily depends on your shell. Usually you'd use something like "JAVA_HOME=<path" after which you can use the "export JAVA_HOME" command to make this variable available in processes you start from there on. i tried this option but when i run apache tomcat 'sh startup.sh' it said 'The JAVA_HOME environment variable is not defined correctly' To make this permanent you'd have to edit /etc/profile or a profile file in your home directory. profile file contains the following code #ident "@(#)profile 1.19 01/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 now what to do in here ty
I would not touch this file. Edit your ~/.profile file, then launch new terminal and you should be set. Verify by running echo $HAVA_HOME HTH, Peter
I should use the 'Preview' button here echo $JAVA_HOME
well i got how to setup java_home JAVA_HOME=/usr/java export JAVA_HOME now i run tomcat but the following error occurs # sh startup.sh Using CATALINA_BASE: /usr/apache/tomcat Using CATALINA_HOME: /usr/apache/tomcat Using CATALINA_TMPDIR: /usr/apache/tomcat/temp Using JAVA_HOME: /usr/java touch: /usr/apache/tomcat/logs/catalina.out cannot create # ./catalina.sh: /usr/apache/tomcat/logs/catalina.out: cannot create help plz!
Hi, Sounds like it is a permission issue with logs might check that out Haggie
There is no /usr/apache/tomcat/logs directory. -- check /usr/apache/tomcat/logs # ls -l /usr/apache/tomcat/logs -- create /usr/apache/tomcat/logs # mkdir /usr/apache/tomcat/logs
Hello, What I have to edit in /etc/profile for that. Please specify.. Thanks Partha
Dear all i am also facing set environment variable in solaris 10 i am not able to set environment variable in solaris 10 permanet. Can you help me any one how can set environment variable permanet in solaris 10. i make variable in .profile PATH=/usr/sbin:/usr/bin:/usr/ccs/bin/as:/usr/local/bin also set JAVA_HOME but after logout agen loging i am not able to access. plesae help me so i can make permanet. my mail id is firstname.lastname@example.org
Hello, I am experimenting with Tomacat on Solaris 10 for the past few days and the JAVA_HOME environment variable appeared to be an issue indeed. What I have done to permanently resolve this is as a start to change the shell for the root username issuing the usermod -s /usr/bin/bash root The magic words in the bash shell for changing or exporting environment variables is export You can also use declare -x In my /.profile file I have inserted the following lines #cat /.profile declare -x PS1="`hostname`#[`logname`]: " export JAVA_HOME=/usr/jdk/jdk1.6.0 export JRE_HOME=/usr/jdk/jdk1.6.0/jre Now you have to logout from the root username and log back in for the changes to take effect. When you log back in you can try to echo the $SHELL variable and make sure that it is /usr/bin/bash For the example I have used both export and declare -x and here is the output when checking the variable and their values: homeserver#: echo $PS1 homeserver#: homeserver#: echo $JAVA_HOME /usr/jdk/jdk1.6.0 homeserver#: echo $JRE_HOME /usr/jdk/jdk1.6.0/jre The same effect can be reached by using the other shells but I find this one my favorite. Line: Cheers, st0ma@
bhupi, I was faced on issue of setting JDK env variable in Solaris 10. Your information helped me a lot... thx u very much