How To Install Java And Tomcat On Ubuntu Gnome 16.045 min read
Ubuntu Gnome is an open-source software. It can be used various purposes such as server and desktop version. I have to configure Java (8.0.144) and Tomcat (8.0.46) on your desktop version. If you can use Apache Tomcat on your Gnome desktop then follow thus step by step my guides.
Configure Java (8.0.144) on your Gnome desktop
Step #01: Create some directory for install Java.
[email protected]:~# mkdir -p /home/local/app/java/jdk/
Then upload all java downloaded file on your jdk directory with version name.
Step #02: Select update alternative path for installation Java and Tomcat.
[email protected]:~# update-alternatives --install "/usr/bin/javac" "javac" "/home/local/app/java/jdk/8.0.144/bin/javac" 1 [email protected]:~# update-alternatives --install "/usr/bin/java" "java" "/home/local/app/java/jdk/8.0.144/bin/java" 1 [email protected]:~# update-alternatives --set "javac" "/home/local/app/java/jdk/8.0.144/bin/javac" [email protected]:~# update-alternatives --set "java" "/home/local/app/java/jdk/8.0.144/bin/java"
Step #03: Create Java Home profile. Open profile file with any editor vi /etc/profile and then insert below line.
JRE_HOME=/home/local/app/java/jdk/8.0.144 PATH=$PATH:$JRE_HOME/bin export JRE_HOME export PATH
Configure Tomcat (8.0.46) on your Gnome desktop
Step #04: Again create tomcat directory
[email protected]:~# mkdir -p /home/local/app/tomcat/
Then upload all downloaded file into tomcat folder with version name.
Step #05: Edit catalina.sh file for setup heap memory on your tomcat bin directory.
[email protected]:~# vim /home/local/app/tomcat/8.0.46/bin/catalina.sh
Then insert below line
JAVA_OPTS="-Dfile.encoding=UTF-8 -server -Xms1024m -Xmx2048m -XX:PermSize=64m -XX:MaxPermSize=256m -Djava.awt.headless=true -XX:+UseParallelGC -XX:MaxGCPauseMillis=100"
Sate and exit.
Step #06: Now create Tomcat service file for start and stop.
Open vim /etc/init.d/tomcat and insert all below lines on your tomcat file.
#!/bin/bash ### BEGIN INIT INFO # Provides:tomcat8 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO JAVA_HOME=/home/local/app/java/jdk/8.0.144 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CATALINA_HOME=/home/local/app/tomcat/8.0.46 case $1 in start) sh $CATALINA_HOME/bin/startup.sh ;; stop) sh $CATALINA_HOME/bin/shutdown.sh ;; restart) sh $CATALINA_HOME/bin/shutdown.sh sh $CATALINA_HOME/bin/startup.sh ;; esac exit 0
Step #07: Then create permission for execute Java and start Tomcat.
[email protected]:~# chmod 755 /etc/init.d/tomcat
[email protected]:~# chmod -R 755 /home/local/app/
[email protected]:~# /etc/init.d/tomcat start
Finally goto your browser and type http://localhost:8080/ press enter or http://Your_server_ip:8080/
If face any problem then see my YouTube video and Subscribe my channel. Please subscribe my channel for more update.
We really appreciate for your support for buying me a coffee.
It takes us a while to compose and upload new content, as they have to be checked to see if Properly works. We appreciate you if you help me for one cup of coffee to keep us awake and always deliver good quality content.
No contribution is small of an amount. We are grateful for any amount you support us with. Thank you!