...
Extract files to
/opt/tomcat
In the directory with the tar file, run
sudo -u tomcat tar -xzvf <tomcat9>.tar.gz --strip-components=1 -C /opt/tomcat
Create a systemd service file for Tomcat
sudo vim /etc/systemd/system/tomcat.service
Paste the following
Code Block [Unit] Description=Apache Tomcat After=network.target [Service] Type=forking User=tomcat Group=tomcat Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 Environment=CATALINA_PID=/opt/tomcat/tomcat.pid Environment=CATALINA_HOME=/opt/tomcat Environment=CATALINA_BASE=/opt/tomcat Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC" ExecStart=/opt/tomcat/bin/startup.sh ExecStop=/opt/tomcat/bin/shutdown.sh ExecReload=/bin/kill $MAINPID RemainAfterExit=yes [Install] WantedBy=multi-user.target
Save the file and exit
Make systemd aware of the new file
sudo systemctl daemon-reload
sudo systemctl enable --now tomcat
(starts Tomcat and also makes it run on startup)start tomcat
sudo systemctl status tomcat
Visit http://localhost:8080/ and you should see a confirmation page
I also followed the steps to create a web manager user, but I don’t believe it’s necessary to continue
Make sure to stop Tomcat before you try running it with IntelliJ later!
sudo systemctl stop tomcat
Install stand-alone version of STEP
...
java.lang.UnsupportedClassVersionError: org/eclipse/jdt/internal/compiler/env/INameEnvironment has been compiled by a more recent version…
Seems I originally installed tomcat9 via
apt
, but it seems like I hit a known bug (The workaround in the first link didn’t work for me… So I re-traced my steps
(undoing the workaround)
sudo apt remove libecj-java
sudo unlink /var/lib/tomcat9/lib/ecj.jar
(undoing our other another workaround for Smart Tomcat, if you used
apt
)sudo unlink /usr/share/tomcat9/conf
(removing tomcat via
apt
)sudo apt purge tomcat9 tomcat9-admin
(purge
removes config files too)
(remove user and group automatically added by
apt
)sudo userdel tomcat
sudo groupdel tomcat