Public bug reported: When I define JAVA_HOME in /etc/default/tomcat9, it's not used by the tomcat9 after the service restart.
I have 2 JDKs installed openjdk-11-jdk openjdk-14-jdk The /etc/default/tomcat9 contains: JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 JAVA_OPTS="-Djava.awt.headless=true -Dspring.profiles.active=production" After the tomcat9 service restart, the Java version used is still 14: java.specification.version=14 == Workaround It started to work with Java 11 when I added following line to the service file (/usr/lib/systemd/system/tomcat9.service): EnvironmentFile=/etc/default/tomcat9 It was followed by: sudo systemctl daemon-reload sudo systemctl restart tomcat9.service ProblemType: Bug DistroRelease: Ubuntu 20.04 Package: tomcat9 9.0.31-1 [modified: lib/systemd/system/tomcat9.service] ProcVersionSignature: Ubuntu 5.4.0-31.35-generic 5.4.34 Uname: Linux 5.4.0-31-generic x86_64 ApportVersion: 2.20.11-0ubuntu27 Architecture: amd64 CasperMD5CheckResult: skip CurrentDesktop: MATE Date: Tue May 26 14:22:05 2020 InstallationDate: Installed on 2020-04-30 (25 days ago) InstallationMedia: Ubuntu-MATE 20.04 LTS "Focal Fossa" - Release amd64 (20200423) PackageArchitecture: all SourcePackage: tomcat9 UpgradeStatus: No upgrade log present (probably fresh install) modified.conffile..etc.default.apport: [modified] modified.conffile..etc.tomcat9.policy.d.01system.policy: [inaccessible: [Errno 13] Permission denied: '/etc/tomcat9/policy.d/01system.policy'] modified.conffile..etc.tomcat9.policy.d.02debian.policy: [inaccessible: [Errno 13] Permission denied: '/etc/tomcat9/policy.d/02debian.policy'] modified.conffile..etc.tomcat9.policy.d.03catalina.policy: [inaccessible: [Errno 13] Permission denied: '/etc/tomcat9/policy.d/03catalina.policy'] modified.conffile..etc.tomcat9.policy.d.04webapps.policy: [inaccessible: [Errno 13] Permission denied: '/etc/tomcat9/policy.d/04webapps.policy'] modified.conffile..etc.tomcat9.policy.d.50local.policy: [inaccessible: [Errno 13] Permission denied: '/etc/tomcat9/policy.d/50local.policy'] mtime.conffile..etc.default.apport: 2020-05-02T16:24:39.955346 ** Affects: tomcat9 (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug focal -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1880694 Title: The tomcat9.service doesn't use JAVA_HOME defined in /etc/default/tomcat9 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tomcat9/+bug/1880694/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs