3 Replies Latest reply: Mar 29, 2013 2:09 PM by rp0428 RSS

    JAVA upgrade

    999976
      Good morning everyone,
      I am currently upgrading from JAVA 1.4 to JAVA 6 SE. Some of the methods and classes have either been deprecated or there are a lot of warnings due to inefficient practices. I want to know if it is possible for me to upgrade without making any changes to my code and after the changes remote debug to fix the errors. If there's a simpler or more efficient way of doing this please share. Thank you in advance for your help.
        • 1. Re: JAVA upgrade
          gimbal2
          996973 wrote:
          Good morning everyone,
          I am currently upgrading from JAVA 1.4 to JAVA 6 SE.
          Its "Java". Its a name, not an acronym.
          Some of the methods and classes have either been deprecated or there are a lot of warnings due to inefficient practices. I want to know if it is possible for me to upgrade without making any changes to my code and after the changes remote debug to fix the errors.
          Maybe, maybe not. The deprecated stuff isn't going to hurt you, its just going to stay deprecated (but you should consider taking the deprecated stuff out; its deprecated for a good reason, usually that reason is it being not well designed or a bad idea). You may run into a little trouble if you used the keyword 'enum' somewhere; but that's as simple as changing the name of the variable.
          If there's a simpler or more efficient way of doing this please share. Thank you in advance for your help.
          Nope, software engineering is hard. Sometimes you have to bite a hard bullet. Fingers crossed that your upgrade will be painless. And I would upgrade to Java 7 in stead of Java 6, or you'll be perpetually running behind. Java 6 support is ending too you know.
          • 2. Re: JAVA upgrade
            939520
            Yep, I agree with the previous post. I suggest you approach this project by running it with the old version of Java first to verify you can install, compile, deploy and test it before making any changes (one headache at a time). Then switch to the new version of Java, fix any compile errors (only), and recompile/deploy/test without errors. Then next work on only a few deprecated issues at one time before recompile/deploy/test. If instead you fix a bunch of stuff at once at it doesn't work, its harder to find where you broke the code. Lastly, consider fixing any warnings (non deprecated stuff) the compiler flags you about (not that you absolutely have to).
            • 3. Re: JAVA upgrade
              rp0428
              >
              I am currently upgrading from JAVA 1.4 to JAVA 6 SE.
              >
              Why? What is the purpose of the upgrade? Just to get current with Java? Or do you need to work with third-party libraries or a web/app server that is using a newer Java version?

              Do you plan to continue to execute your current 1.4 class files using 1.6 runtime? Or are you going to replace your current class/jar files with the same code recompiled using 1.6?

              Do you use JDBC? If so, that jar file should be upgraded also.

              There were also changes made to some interfaces and classes that are NOT compatible with the newer version. For example the java.sql.Connection interface had new methods added AFTER version 1.4 and if you have code that implements that interface your code won't even compile.

              As others have stated until your code at least compiles your app is broken and there won't be any new class or jar files t even use.
              >
              I want to know if it is possible for me to upgrade without making any changes to my code and after the changes remote debug to fix the errors
              >
              Why are you asking us? Just install a new Java version and try using it to run your app. If your app tests ok then you don't need to make any changes.

              We have no way of knowing what is in your code. If all you have is a simple 'Hello World' application you are unlikely to have any serious issues.