Apollo icon indicating copy to clipboard operation
Apollo copied to clipboard

Ubuntu 20.04 Tomcat 8 required.

Open alpapan opened this issue 3 years ago • 2 comments

Will not work as it can't parse the version.

the solution is to use java 8

Grails not found using grailsw
Using gradlew

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '11.0.8'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Gradle version:
Node Version: 10
Npm Version: 6
Yarn Version: 1
javac 1.8.0_265 found
javac installed
JDK 1.8 found: javac 1.8.0_265

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '11.0.8'.

alpapan avatar Oct 15 '20 22:10 alpapan

It looks like there are 2 versions available , which is a PITA.

Even if it parsed JDK 11 correctly it will tell you to use JDK 8 .

Sometimes I’ve had luck using jenv, but I would just use jdk8 if you can get away with it.

Nathan

On Oct 15, 2020, at 3:26 PM, Alexie Papanicolaou [email protected] wrote:

Will not work as it can't parse the version.

the solution is to use java 8

Grails not found using grailsw Using gradlew

FAILURE: Build failed with an exception.

  • What went wrong: Could not determine java version from '11.0.8'.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Gradle version: Node Version: 10 Npm Version: 6 Yarn Version: 1 javac 1.8.0_265 found javac installed JDK 1.8 found: javac 1.8.0_265

FAILURE: Build failed with an exception.

nathandunn avatar Oct 15 '20 22:10 nathandunn

Sorry for delay (I only get a couple of hours a week to do things i like ;-()

Some more info to help ubuntu 20.04 users or anyone else (debian) using systemctl

Systemctl sandboxes tomcat (and other services). So the following may be required in the systemctl service file (inside /lib/systemd/system):

Assuming your catalina home is /path_to_catalina/ and tmp directory for tomcat is /path_to_tmp/tomcat:

RequiresMountsFor=/var/log/tomcat9 /path_to_catalina /path_to_tmp/tomcat

#the following may not be read for some reason, hence some duplicated in /etc/default/tomcat9
Environment="JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64"
Environment="CATALINA_HOME=/path_to_catalina"
Environment="CATALINA_BASE=/path_to_catalina" # I copied the bin etc here because i run more than one tomcat instance, otherwise original is /usr/share/tomcat9
Environment="JAVA_OPTS=-Djava.awt.headless=true -Xmx12288m -Xms8192m  -XX:ReservedCodeCacheSize=64m -XX:+UseG1GC -XX:+CMSClassUnloadingEnabled \
             -Xloggc:$CATALINA_HOME/logs/gc.log -XX:+PrintGCDetails"
Environment="CATALINA_TMPDIR=/path_to_tmp/tomcat"
Environment="PERL5LIB=/scratch_cory/sysadmin/apollo/git/extlib/lib/perl5:$PERL5LIB"
Environment="TMPDIR=/path_to_tmp/tomcat"
Environment="TMP=/path_to_tmp/tomcat"

[..]
ReadWritePaths=/path_to_catalina//conf/Catalina/localhost
ReadWritePaths=/path_to_catalina//webapps/
ReadWritePaths=/path_to_catalina/work/
ReadWritePaths=/var/log/tomcat9/
ReadWritePaths=/path_to_tmp/tomcat/

Don't forget to own the right directory

chown tomcat:tomcat /path_to_tmp/tomcat /path_to_catalina/ -R

Further, /etc/default/tomcat9 has some configs that I could not get included in the systemctl even though the script that systemctl uses is meant to add them...

JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

JAVA_OPTS="-Djava.awt.headless=true  -Xmx12288m -Xms8192m -XX:ReservedCodeCacheSize=64m -XX:+UseG1GC -XX:+CMSClassUnloadingEnabled -Xloggc:/var/log/tomcat9/gc.log  -XX:+PrintGCDetails"

alpapan avatar Oct 27 '20 09:10 alpapan