Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the pitfalls when upgrading to Java 7

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?

like image 530
AndreyKo Avatar asked May 31 '12 12:05

AndreyKo


2 Answers

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.
like image 63
Aaron Digulla Avatar answered Oct 31 '22 16:10

Aaron Digulla


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!

like image 22
Arne Burmeister Avatar answered Oct 31 '22 16:10

Arne Burmeister