Question: When I shutdown tomcat on server it show following error

```
Using CATALINA_BASE:   /usr/local/tomcat7/apache-tomcat-7.0.52
Using CATALINA_HOME:   /usr/local/tomcat7/apache-tomcat-7.0.52
Using CATALINA_TMPDIR: /usr/local/tomcat7/apache-tomcat-7.0.52/temp
Using JRE_HOME:        /usr/local/java/jre*
Using CLASSPATH:       /usr/local/tomcat7/apache-tomcat-7.0.52/bin/bootstrap.jar:/usr/local/tomcat7/apache-tomcat-7.0.52/bin/tomcat-juli.jar
./catalina.sh: 1: eval: /usr/local/java/jre*/bin/java: not found

```

and its also not update database
please help .

Answer: 
You need set the `JAVA_HOME` path us [environment variables](https://help.ubuntu.com/community/EnvironmentVariables#Other_files-1). Add in shell config file `/etc/bash.bashrc` path variables. For do this just run follow command in terminal:

```
sudo nano /etc/bash.bashrc

```

And copy & past follow code in bottom of the file:

```
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0
export PATH=$PATH:$JAVA_HOME/bin

```

Also visit: [How to set JAVA\_HOME in Ubuntu?](https://stackoverflow.com/questions/6477415/how-to-set-java-home-in-ubuntu).
This error may sound silly, 

but try to shutdown using `sudo`

from the `bin` folder in tomcat directory run:

`$ sudo ./shutdown.sh`