I'm trying to install tomcat7 using Ansible. After installation, when restarting service, I'm getting errors because there is no java_home set :
no JDK or JRE found - please set JAVA_HOME
I know I can set the java_home value in /etc/default/tomcat7, but what I'm looking for, is why JAVA_HOME is not set by default to the only installed Java and we have to do it manually before starting any Java application/server :
update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java Nothing to configure.
I'm using trusty 14.04 and openjdk8