0 Replies Latest reply: Oct 20, 2010 6:38 AM by 801338 RSS

    adding an old jre without messing with current jdk

    801338
      I'm running JDK 1.6. In [url http://forums.oracle.com/forums/thread.jspa?threadID=1517785&tstart=0]another thread it was suggest I compile my applet for older environments:
      Andrew Thompson wrote:
      RichF wrote:
      ..I don't have an older version of JDK, but maybe I could download one. That's kind of funny, though. Until a couple weeks ago the applet had remained the same for 10 years, built with JDK 1.2. It was originally built with 1.1, but 1.2 came out while I was still active with it. I've gone thru a couple computers since then, and hadn't done another Java project until I decided to update the color wheel, adding a library of over 1500 color names.

      I wonder what I'm using that older versions of the JRE don't support...
      It is all about the cross-compilation options of javac that you are probably not using when compiling the classes. The important ones are -source and -target, while an even more important option is -bootclasspath.

      The first two require a number, such as 1.3/1.1, while the last requires the path to an rt.jar of the required Java version. The rt.jar holds the core classes of the J2SE. Note that it does not specifically require an SDK to get that rt.jar, just a JRE.

      Using the correct options (and suitable code), it is possible to use a 1.5 or 1.6 compiler to produce code that should work in a Java 1.1 JRE.
      I've downloaded j2re-1_4_2_19-windows-i586-p.exe but am hesitant to install it, thinking installation might mess with my actual environment. Apparently all i really need is its file rt.jar so that -bootclasspath can validate against it. Should I just go for it and install, or are there preparations I should make first to avoid breaking anything?

      -- Rich

      PS: I realize this is more of a "Java Downgrade" than a "Java Upgrade" question, but this still seems like the best place to ask.