Thursday, October 20, 2016

Install Oracle JDK 8 and Apache Tomcat 8

Installing the Oracle JDK
=========================

1. sudo add-apt-repository ppa:webupd8team/java
2. sudo apt-get update
3. sudo apt-get install oracle-java8-installer
4. sudo update-alternatives --config java
5. sudo vi /etc/environment
 JAVA_HOME="/usr/lib/jvm/java-8-oracle"
6. source /etc/environment


Installing Apache Tomcat 8
==========================
1. sudo apt-get install tomcat8 tomcat8-docs tomcat8-admin tomcat8-examples
2. dpkg -L tomcat8
3. sudo vi /etc/tomcat8/server.xml

change port 8080 to 8081 since jenkins is using 8080

4. sudo /etc/init.d/tomcat8 restart
5. Check: http://localhost:8081
6. sudo vi /opt/tomcat/conf/tomcat-users.xml
7. sudo /etc/init.d/tomcat8 restart

Re-installing Tomcat 8
======================
1. Getting errors

 Errors were encountered while processing:
 tomcat8
 E: Sub-process /usr/bin/dpkg returned an error code (1)

2. sudo dpkg -P libtomcat8-java tomcat8-common tomcat8-docs tomcat8 tomcat8-examples tomcat8-admin

3. sudo apt-get purge libtomcat8-java tomcat8 tomcat8-admin tomcat8-common tomcat8-docs tomcat8-examples tomcat8-user

4. sudo reboot

No comments:

Post a Comment