I would like to know: would it work smoothly if a webapp compiled with jdk8 running in Tomcat 7 where JDK7 is only installed. This question is actually about java running procedure, so instead of yes or no, please explain a little. Thanks.
Asked
Active
Viewed 25 times
0
-
1No, a class incorporating JDK8 features can't run on JDK7. – Denys Séguret Sep 18 '16 at 08:56
-
@DenysSéguret Would it be able to run if it didn't use any JDK 8 features? Not that I'm suggesting the OP should go down this road, just curious. – Tim Biegeleisen Sep 18 '16 at 08:59
-
@DenysSéguret what if in the same host of tomcat7, JDK 8 is installed? – Tiina Sep 18 '16 at 09:11
-
2@TimBiegeleisen If it didn't use language features *or* the APIs. It'd have to be done with `-target 1.7`. – chrylis -cautiouslyoptimistic- Sep 18 '16 at 09:12
-
Today I have been through: Tomcat7 is jdk7, and if a war is compiled using jdk8, it would be "java.lang.UnsupportedClassVersionError Unsupported major.minor version 51.0". UnsupportedClassVersionError is compiler version is higher than the runtime jdk version. – Tiina Oct 13 '16 at 08:38