Link to home
Start Free TrialLog in
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

asked on

How to target JRE 1.5?

Hi,

In eclipse, I see my java project is using JRE 1.6.

Unfortunately the mac I'm targeting is only at JRE 1.5, and it looks like that's not going to change.

Can I somehow download the old JRE on my system (without messing up the current one...) and have eclipse recompile the project using JRE 1.5? I'm on a windows machine.

Thanks
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

ASKER

Actually i just downloaded a different JRE and see how to use it for compilation.

I'm using JRE 1.5.0_06 while the mac I'm targeting has 1.5.0_16-b06-284.

I don't get any useful error messages, just:

  java.lang.UnsupportedClassVersionError: Bad version number in .class file
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at
      .....
     sun.applet.AppletPanel.run(AppletPanel.java:326)
     at java.lang.Thread.run(Thread.java:613)

what does that mean?
ASKER CERTIFIED SOLUTION
Avatar of javaexperto
javaexperto
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hmm I don't understand - in eclipse I don't see anyplace to choose which JDK version to compile with - only to choose which JRE to target. So my JDK is fixed, but the JRE can be variable. What should I do?
SOLUTION
Avatar of Muhammad Khan
Muhammad Khan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, well that fixed it, I picked a 5.0 compatible JDK.

However the applet just exits with no error recorded in the log files. So much for cross platform compatibility!

Thanks