0

We have a ubuntu server running java 8:

$ java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

And tomcat7:

/usr/share/tomcat7/bin$ ./version.sh 
Using CATALINA_BASE:   /usr/share/tomcat7
Using CATALINA_HOME:   /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/share/tomcat7/bin/bootstrap.jar:/usr/share /tomcat7/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.26
Server built:   Apr 1 2013 08:32:04
Server number:  7.0.26.0
OS Name:        Linux
OS Version:     3.2.0-48-generic
Architecture:   amd64
JVM Version:    1.8.0_77-b03
JVM Vendor:     Oracle Corporation

But when I try to access my jsp, it gives this error:

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 1 in the generated java file The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files

Java 8 is correctly defined under JAVA_HOME in /etc/default/tomcat7

On a side note, we have another identical server that works fine, but with an earlier version of the war-file. My colleagues suggest that I must upgrade tomcat. The theory is that if we upgrade this other server, it will also stop working.

Community
  • 1
  • 1
Gunslinger
  • 729
  • 1
  • 9
  • 19
  • can you post the <%@page import=.. %> header of your jsp, or better your jsp ? – BigMike Mar 31 '16 at 08:45
  • have you tried pointing tomcat to an JDK instead of a JRE, this could be necessary for some JSP stuff, see e.g. https://stackoverflow.com/questions/16726897/what-tomcat-requires-jdk-or-jre – Raphael Roth Mar 31 '16 at 08:48
  • 1
    The suggestion to upgrade is correct. There is at least one component bearing a compiler that is not up-to-date in your environment. See [this answer](http://stackoverflow.com/a/26105217/2711488). It’s a recurring issue, like [here](http://stackoverflow.com/questions/26700824/jdk-8-the-type-java-util-mapentry-cannot-be-resolved?lq=1)… – Holger Mar 31 '16 at 10:12
  • @Holger if you post this as an answer I will accept it. – Gunslinger Mar 31 '16 at 10:29
  • I’d rather close it as duplicate. It’s not your fault, Stackoverflow’s search function apparently doesn’t work when searching for `Map$Entry`, but [they are there](http://stackoverflow.com/questions/linked/26102115)… – Holger Mar 31 '16 at 10:33
  • @Holger feel free. :-) – Gunslinger Mar 31 '16 at 10:35

0 Answers0