Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Migration from JDK 1.5 to 1.6

Tags:

java

eclipse

What are the steps to be followed for Migration of code from JDK 1.5 to 1.6.

Steps followed :

  1. Changed the build Patch of Project as JDK1.6
  2. Changed the Compiler as 6
  3. Clean and deploy the Project
  4. I was getting Compilation error as
       *** ERROR ***: Thu Apr 01 05:17:06 PDT 2010    org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException: WEB-INF/web.xml
    Stack trace of nested exception:
    java.lang.ClassCastException: org.eclipse.jst.javaee.web.internal.impl.WebAppDeploymentDescriptorImpl cannot be cast to org.eclipse.jst.j2ee.webapplication.WebApp
        at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.War22ImportStrategyImpl.loadDeploymentDescriptor(War22ImportStrategyImpl.java:87)
        at org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.War22ImportStrategyImpl.importMetaData(War22ImportStrategyImpl.java:81)
        at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getDeploymentDescriptor(WARFileImpl.java:145)  



*** ERROR ***: Thu Apr 01 05:17:06 PDT 2010    org.eclipse.wst.validation.internal.core.ValidationException: CHKJ3000E: WAR Validation Failed: org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException: WEB-INF/web.xml
        at org.eclipse.jst.j2ee.model.internal.validation.WarValidator.validateInJob(WarValidator.java:343)
        at org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator.validateInJob(UIWarValidator.java:111)
        at org.eclipse.wst.validation.internal.operations.ValidatorJob.run(ValidatorJob.java:75)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
like image 318
Rajesh Ranjan Avatar asked Apr 02 '10 07:04

Rajesh Ranjan


3 Answers

In the vast majority of cases, you don't need to do anything at all. Even recompiling is not strictly necessary.

The few incompatibilities that exist between Java 5.0 and 6.0 are documented in the JDK 6 Adoption Guide.

like image 138
Stephen C Avatar answered Sep 16 '22 19:09

Stephen C


The code that ran on Java 1.5 will run on 1.6 without any modifications(in you weren't using any internal APIs that is). The public Java api is always forward compatible.

like image 33
Bozhidar Batsov Avatar answered Sep 20 '22 19:09

Bozhidar Batsov


Recompile with new JDK, check warnings (maybe some of classes or methods are deprecated), check if application work as expected.

like image 30
Michał Niklas Avatar answered Sep 16 '22 19:09

Michał Niklas