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.
★ How To Install Java And Tomcat on Windows
★ How To Configure Static IP address On Ubuntu 18.04
At first download Java (8.0.144) and Apache Tomcat (8.0.46)
Configure Java (8.0.144) on your Gnome desktop
Step #01: Create some directory for install Java.
root@tech-ubuntu:~# 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.
root@tech-ubuntu:~# update-alternatives --install "/usr/bin/javac" "javac" "/home/local/app/java/jdk/8.0.144/bin/javac" 1 root@tech-ubuntu:~# update-alternatives --install "/usr/bin/java" "java" "/home/local/app/java/jdk/8.0.144/bin/java" 1 root@tech-ubuntu:~# update-alternatives --set "javac" "/home/local/app/java/jdk/8.0.144/bin/javac" root@tech-ubuntu:~# 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
root@tech-ubuntu:~# 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.
root@tech-ubuntu:~# 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.
root@tech-ubuntu:~# chmod 755 /etc/init.d/tomcat
root@tech-ubuntu:~# chmod -R 755 /home/local/app/
root@tech-ubuntu:~# /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.
- How To Install Zabbix Server 6.4 On AlmaLinux 8 Server - August 9, 2024
- How To Clear RAM Memory Cache Buffer Linux Server - February 29, 2024
- How To Install Apache Cloud Stack Management Server 4.17 On Ubuntu 22.04 - February 1, 2024
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!