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.
Related
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.*.
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.
Have a problem. Before start server jboss 7.1.1, I have a problem:
**Error:** JDK 1.7 (or earlier) should be specified either as project SDK or
alternative JRE
I am using jdk 1.8 In project. And I can use only 1.6 JRE for working with JBOSS.
If I used 1.8 at project, and 1.6 jre with jboss, I take error with unsupported major.minor version 52.0.
Can I change jdk for JBOSS on 1.8? And how to do it?
I found the posting below on the JBoss developer developer forum.
The short version is that you would need to backport various bug fixes to JBoss AS 7 in order to get it run on a Java 8 JRE. It would be better / easier to upgrade to Wildfly. (He says.)
Re: AS 7 on Java 8 by Tomaz Cerar Apr 8, 2015 6:18 AM (in response to Matija Vizintin)
Any big reason you cannot upgrade to WildFly 8?
Core issue that prevents boot of AS7 on JDK8 is
https://issues.jboss.org/browse/WFLY-2057
which was fixed by
https://github.com/wildfly/wildfly/commit/fa93ceff49c3e84851cb8b00157e4fbed1d2cdb7
You could apply this commit to
https://github.com/wildfly/wildfly/releases/tag/7.2.0.Final-testsuite-fix
tag and rebuild it.
but, this will only make sure server starts on JDK8, there ware
handful of other fixes / changes that we needed to address to make
sure testsuite passes properly.
In any case, i would recommend you to go with WildFly 8.2.0.Final.
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 am switching an enterprise application built on Spring 3.1.0, Hibernate 3.6.0 from Java 6 32bit to Java 7 64 bit.
Has anybody done that? Any problems? Are there any resources on the subject?
Here are the pitfalls I know about:
You might have to upgrade your IDE to be able to enable Java 7 features.
Make sure that command line tools and your IDE use the same Java version. If you're using Maven, for example, look into $HOME/.mavenrc and/or check the environment variable JAVA_HOME
Check the source/target options of the Java compiler.
Java 7 supports generics better than Java 6 so some code will now compile that failed with Java 6
The 64bit version of Java uses a lot more memory than the 32bit version
The first release of Java 7 had a severe bug in the JIT compiler which broke Lucene. Use at least b2 or better.
Java 7 uses the newer JAXB 2.2 instead of 2.1 (the full change on the XML stack is described here). These versions are not compatible on generated code for Boolean getters and setters!