Recently, our online web service using tomcat 7.0.23.0 and JVM 1.7.0_51-b13 need to upgrade to java 8, which tomcat version is suitable for java 8 ?
See this link
http://tomcat.apache.org/whichversion.html
for details about which tomcat versions are supported on which java versions.
According to that link, tomcat 7.0.23.0 should work on java 8
Tomcat 7 is good and works well for Java 8 however, not recommended for Java8 as all features of Java 8 were not supported in tomcat 7.
Please use tomcat 9.x with Java 8 (Recommended from Tomcat Apache)
Please refer http://tomcat.apache.org/whichversion.html
Latest stable version supported on Java 8 is Tomcat 10 but the users of Tomcat 10 onwards should be aware that, as a result of the move from Java EE to Jakarta EE as part of the transfer of Java EE to the Eclipse Foundation, the primary package for all implemented APIs has changed from javax.* to jakarta.*.
Related
I have my Java code compiled in jdk 1.6.
I am using MQ jar files (From MQ version 8.0) in my project build path.
My application server runs with jdk 1.6.
MQ version 8.0 installed in the server.
Now when I have deployed my application in the server, I am getting errors like :
java.lang.UnsupportedClassVersionError" and errors related to major
version 50, 51 etc.
I understand the concepts of the version here, but I am little confused as why in the runtime there is a version mismatch happening as in the classpath it is referring to the same JAR files as during the project build. Is it due to the fact that MQ jars has been compiled in 51 which is of a higher version than 50 ? Please advise what can be done here.
To use the jar files that come with IBM MQ v8 and later you must be at Java 7 or later. IBM Documents that from MQ v8 and later that the IBM MQ classes for Java and JMS are built with Java 7. Oracle documents that classes built with Java 7 cannot be used with Java 6. See below for references:
In the MQ v8.0 KC page: IBM MQ 8.0.0>IBM MQ>Product overview>What's changed in IBM MQ Version 8.0.0>Java: changes for Java 7
The IBM MQ classes for Java and IBM MQ classes for JMS are now built
with Java 7.
The Java 7 runtime environment supports running earlier class file
versions.
In the MQ v9.0 KC page: IBM MQ 9.0.x>IBM MQ>Technical overview>IBM MQ Java language interfaces
From IBM MQ Version 8.0, the IBM MQ classes for Java and IBM MQ classes for
JMS are built with Java 7. The Java 7 runtime
environment supports running earlier class file versions.
Oracle documents that Java 7 class files cannot be used with Java 6 in the following page:
Oracle Java SE 7 and JDK 7 Compatibility -> Binary Compatibility states the following:
The class file version for Java SE 7 is 51, as per the JVM
Specification, because of the invokedynamic byte code introduced by
JSR 292. Version 51 class files produced by the Java SE 7 compiler
cannot be used in Java SE 6.
#JoshMc has been absolutely correct with the explanations of version mismatch of java and mq jars and all.
I would like to add that though I could understand the error when it occurred by seeing the mismatch between 51 and 50, but my issue was to somehow connect to MQ and make the application running without changing the existing installations. That's why I could not upgrade my java to JDK 1.7.
However I solved my problem by using old MQ 7 jars in the classpath for Weblogic Server. Because as my application behaves like a client there won't be any problem while connecting to the MQ server which has version 8 using MQ jars which has been built with java 6. So I have just copied old MQ 7 jars in a folder and used that path in my Weblogic CLASSPATH reference and that solved my problem.
My organization is migrating from a Java 6 / Tomcat 6 environment to a Java 8 / Tomcat 8 environment.
I would like to keep things simple on my development box by setting up as follows:
Java 6 and Java 8 installed on the box.
Java 8 as the default version of Java.
Tomcat 8 as the application server, running on Java 8.
Eclipse with two workspaces, one configured for Java 6 and one for Java 8, both deploying on the Tomcat 8 server. The idea is to use the Java 6 workspace for maintenance work so that I can deploy on the old Java6/Tomcat6 server, and to use the Java 8 workspace for new and migrated work.
I would swear I did exactly this without thinking in my prior development box (that died of hardware failure) and that I experienced no problems at all, but I am not certain.
Is this a reasonable setup?
If it is supposed to work, is it because the application is working in a backward compatible mode?
Input would be greatly welcome. I've been hunting all over the web unsuccessfully. Thanks.
See the tomcat link for compatibility as follows :
http://tomcat.apache.org/whichversion.html
tomcat 8 on java 8 will definitely support applications built for java 6 and tomcat 6. I saw code where they are using a code from jdk 1.2 which runs on jdk 6 and tomcat 7.
Few exceptions would be some deprecated methods if you have used in earlier versions of java which will not be supported as it may be removed from newer version of java.
Also if you use third party libraries, you may need to maintain java version compatibility among them.
Otherwise it should work perfectly fine.
I work for a corporation that won't upgrade from JRE 6 to JRE 7 on our servers. I have successfully developed some code that works on JRE 7 using Jetty 9. However, I can't run this code on the corporation server. I was wondering if anyone out here knew of a way to run Jetty 9 on JRE 6. I specifically need the HTTPConfiguration class from Jetty 9.
The only potential thing I can think of would be to download Jetty, set it to a 1.6 compliance and work from that. I'm really hoping (with a shot in the dark) that someone has a better idea.
No, Jetty 9 required Java 7 since the servlet api (servlet 3.1) requires Java 7. While 9.0 could have in theory worked on Java 6 our intent had been that 9 would be servlet 3.1 and it wasn't until 9.1 that we made the servlet api switch...which was mostly due to timing issues more than anything.
[update] Jetty 9.2.x is Java 7 and Jetty 9.3.x onwards will require Java 8. This is largely due to requirements of supporting the HTTP/2 protocol which Jetty 9.3.x does...in spades.
I recently one of my projects to Spring 4.0.0.RELEASE
After deploying the project to my staging environment, I recognized an Exception with the following Message: bad major version at offset=6. My assumption is, that Sping 4 is not working with Java 6 (which I am forced to, because I can not change it on the system)
(Actually I even was not aware, that a JAR is depending on the Java Version)
Christian Rockrohr My assumption is, that Sping 4 is not working with Java 6
This is wrong assumption.
Spring requires JVM 1.6 or higher, as of Spring 4.0. *****
Java 8 (as well as 6 and 7)
Spring remains compatible with older versions of Java and the JDK: Concretely, Java SE 6 (specifically, a minimum level equivalent to JDK 6 update 10, as released in late 2008) and above are still fully supported. However, for newly started development projects based on Spring 4, we recommend the use of Java 7 or 8.
Read also:
java.lang.UnsupportedClassVersionError: bad major version at offset=6
This look like running a Spring 4 application with JDK 1.5.
Confirmed:
Christian Rockrohr: Indeet, there is Java 1.5 installed on my AS400, it is not Java 1.6. That's is the reason, why Spring did not work. I just returned to Spring 3.1.0.RELEASE and it worked.
*****) http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/JdkVersion.html
jdk 1.6 update-18 or above(latest in 1.6 jdk is jdk-6u-45) versions will support spring 4.0
An exception like this
java.lang.UnsupportedClassVersionError: bad major version at offset=6
Will occure when code is compiled for java version 6, but one try to run it with java 5.
I'm using Netbeans 7.2 with apache tomcat server of version 5.5.It is not supporting java 7 features and asking to set server level to 7? how can i do that? or should i use other server?which one will u recommend?
Apache Tomcat 7 does work with Java 7. You can check Tomcat 7 latest changelog at http://tomcat.apache.org/tomcat-7.0-doc/changelog.html
Note: Most of the times, it's good to start your development with latest server available (unless you have a very specific version requirements)
There is no Tomcat version that support Java 7 currently.All the currently supported Apache Tomcat versions (5.5.x, 6.0.x and 7.0.x) are known to run correctly on Java 6.