• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Incompatible Java Versions

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
     
    Bartender
    Posts: 11497
    19
    Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
     
    Java Cowboy
    Posts: 16084
    88
    Android Scala IntelliJ IDE Spring Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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.
     
    Sheriff
    Posts: 22783
    131
    Eclipse IDE Spring VI Editor Chrome Java Windows
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    thanks for all the pointers... none of them were null!
    - Dan
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic