Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Incompatible Java Versions

 
Dan McGinn-Combs
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently started working in an environment which runs Java v1.4.2 on the server and in production. While trying to set up my workstation development environment, I found that I could no longer download Oracle JDK. I need to be able to compile code offline and generate WAR/EAR files to deploy into the test environment (there is no viable dev environment for this).

the most significant piece of code that suffers from 1.4.2 vs. 1.6 disparity is the parsing of time/date formats using SimpleDateFormat:


so, two questions:
  • Is there a compile option that will allow me to use the 1.6 compiler to generate code for a 1.4.2 server? (or where can I find Windows versions of the JDK?)
  • and
  • How can I simply rewrite the date/time arithmetic for 1.4.2?


  • thanks!
    - Dan
     
    Maneesh Godbole
    Saloon Keeper
    Posts: 11183
    15
    Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ...or where can I find Windows versions of the JDK?

    Check out the section titled "Java SE 6 Update 26" here http://www.oracle.com/technetwork/java/javase/downloads/index.html
    Clicking on the red JDK button should take you to the download section
     
    Jesper de Jong
    Java Cowboy
    Saloon Keeper
    Posts: 15484
    43
    Android IntelliJ IDE Java Scala Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Java 1.4.2 is so old that you cannot get it easily anymore. This page on Oracle's website explains more: Java 2 Platform, Standard Edition, v 1.4.2.

    Here is the download page for JDK 1.4.2 releases.

    Note that support for Java 1.4.2 is no longer free. You will not get security updates and bug fixes for Java 1.4.2 for free anymore. If your company for some reason doesn't want to upgrade to a newer version, they can purchase business support for Java 1.4.2 from Oracle. It would be better if your company would seriously consider upgrading to at least Java 6.
     
    Rob Spoor
    Sheriff
    Pie
    Posts: 20667
    65
    Chrome Eclipse IDE Java Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Dan McGinn-Combs wrote:Is there a compile option that will allow me to use the 1.6 compiler to generate code for a 1.4.2 server?

    Use the -source 1.4 and -target 1.4 compiler flags, and make sure that you do not use any class, method or field that was added in Java 5.0 or beyond. If you use any of those you'll get a NoClassDefFoundError, NoSuchMethodError or NoSuchFieldError during runtime.

    If you use Eclipse and have some old 1.4 JRE installed you can setup the 1.4 JRE inside Eclipse and use that for the project; that will help you prevent the usage of newer features. You can also set the compiler version to 1.4 from Eclipse.
    Netbeans probably has similar features but I haven't used Netbeans so I couldn't confirm this.
     
    Dan McGinn-Combs
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    thanks for all the pointers... none of them were null!
    - Dan
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic