javatomcatjava-8windows-subsystem-for-linuxtomcat9

installing tomcat 9 on WSL


After installing tomcat 9 on WSL, it isn't recognized by system.

Since systemctl command doesn't work on WSL, I used below command:

sudo service tomcat9 start

returning

tomcat9: unrecognized service

I followed 2 ways to install, but the same problem occurred.

References are:

https://www.digitalocean.com/community/tutorials/install-tomcat-9-ubuntu-1804

https://linuxconfig.org/ubuntu-20-04-tomcat-installation

Is there any clue for this problem?

Here is my environment:

windows 10 version 2004

ubuntu 20.04 (WSL)

openjdk version: "1.8.0_265"

update:

I did same process on gcp vm instance on which ubuntu 20.04 is installed to investigate the problem, and found the process has no problem on ubuntu 20.04, not on WSL.

So I assume that this problem is derived from WSL.

Logging all my process expecting someone to find a solution to install tomcat 9 on WSL-ubuntu.

java install

sudo apt update
sudo apt install openjdk-8-jdk

set JAVA_HOME in /etc/environment

JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin"

source /etc/environment

tomcat 9 install

sudo apt install tomcat9 tomcat9-admin

check whether port 8080 is open (positive)

ss -ltn

check whether service command works (positive)

sudo service tomcat9 stop
sudo service tomcat9 start

Solution

  • It seems the tomcat9 package is broken.

    To use tomcat9 on your WSL you may either :

    Here is what I did to repair the install on my computer :