2

I am having trouble setting up Tomcat 8 on my Pi 3, running Raspbian. I've installed Java 8 and Tomcat 8 but it refuses to start up.

I started by ensuring Java 8 was installed.

pi@raspberrypi:~$ java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)

Then I installed Tomcat via:

apt-get install tomcat8

This has installed it in /etc/tomcat8:

pi@raspberrypi:/etc/tomcat8$ ls
Catalina  catalina.properties  context.xml  logging.properties  policy.d  server.xml  tomcat-users.xml  web.xml

I set JAVA_HOME in bashrc and verified with an echo:

pi@raspberrypi:~ $ echo $JAVA_HOME
/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/

Then I also made sure it was set in /etc/default/tomcat8:

JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt

However, when I try to start my Tomcat server, I get the following error:

pi@raspberrypi:~ $ sudo systemctl start tomcat8
Job for tomcat8.service failed. See 'systemctl status tomcat8.service' and 'journalctl -xn' for details.

The contents of tomcat8.service is as follows:

pi@raspberrypi:~ $ systemctl status tomcat8.service
● tomcat8.service - LSB: Start Tomcat.
Loaded: loaded (/etc/init.d/tomcat8)
Active: failed (Result: exit-code) since Sun 2017-08-20 16:03:21 UTC; 1min 28s ago
Process: 1267 ExecStart=/etc/init.d/tomcat8 start (code=exited, status=2)

Could anyone tell me what I'm missing please?

petehallw
  • 121
  • Related questions are https://unix.stackexchange.com/questions/229523/ , https://unix.stackexchange.com/questions/320314/ , https://unix.stackexchange.com/questions/235891/ , and https://unix.stackexchange.com/questions/318834/ . – JdeBP Aug 20 '17 at 18:22
  • @JdeBP I've checked out those links but I've not been successful yet. I still have the same error. – petehallw Aug 21 '17 at 21:40
  • Do you have the output of journalctl -xn? And also the log file from tomcat would be helpful. – Uwe Plonus Nov 30 '17 at 20:02

1 Answers1

2

I ran through your setup steps using my RPi 3 Model B, running PIXEL via Raspbian.

Once you've installed tomcat8, systemctl needs to be made aware of the change:

sudo systemctl daemon-reload

Then, running:

sudo systemctl start tomcat8

should work, I'd hope.

terdon
  • 242,166
  • 1
    Answering old questions is absolutely fine and much better than leaving comments on them. Welcome aboard! – terdon Mar 23 '18 at 09:55