I got the following trouble:
I wanna use Java Servlet built on target Java-8 with Apache Tomcat 7.0.54.
When I run it on my local machine (Win-64, jdk build 1.8.0-b132) it works perfectly.
But when I deploy it on production (Debian GNU/Linux 7.5 (wheezy), jdk build 1.8.0-b132, Tomcat 7.0.54-2) it throws:
Unsupported major.minor version 52.0 (unable to load class ru.tomtrix.fvds.servlets.ItemServlet)
... that means unsupported Java-8 classes. So what's going wrong to Windows and Linux instances of the same version of Tomcat?
Thank you, everyone, I found what happened. It turned out that JAVA_HOME was not defined in a proper way (as logoff and Marko Topolnik mentioned). I opened /etc/default/tomcat7 and changed this section:
# The home directory of the Java development kit (JDK). You need at least
# JDK version 6. If JAVA_HOME is not set, some common directories for
# OpenJDK, the Oracle JDK, and various Java SE 6+ versions are tried.
#JAVA_HOME=/usr/lib/jvm/openjdk-6-jdk
JAVA_HOME=/path/to/my/jdk
... and everything starts to work! Does Tomcat really use an internal JDK smth like OpenJDK by default?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With