tags:

views:

275

answers:

5

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)
A: 

Download and install JDK 6. Update any environmental variables like JAVA_HOME, JDK_HOME. Make sure that your IDE points to the new library (most IDEs will do it automatically if restarted after the environmental variables have been updated). Update the project settings to use JDK 6 in your IDE for each project respectively.

matsev
+1  A: 

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

Michał Niklas
+9  A: 

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.

Stephen C
+1 : For mentioning the Adoption guide
Everyone
A: 

That depends on your application I suppose here are the list of new features to 1.6 all your code however should work fine.

link java 1.6 features

Paul Whelan
+2  A: 

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.

Bozhidar Batsov