Solved

How to target JRE 1.5?

Posted on 2008-10-20
5
557 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:DJ_AM_Juicebox
  • 3
5 Comments
 

Author Comment

by:DJ_AM_Juicebox
ID: 22764638
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?
0
 
LVL 6

Accepted Solution

by:
javaexperto earned 250 total points
ID: 22764654
well it means that your .class file was compiled with other version of the JDK and you are trying to run with another JRE versión.
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 22766170
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?
0
 
LVL 17

Assisted Solution

by:aiklamha
aiklamha earned 250 total points
ID: 22766268
To compile you need a compatible JDK...

In my version of eclipse... (i.e. 3.1) i would right click on my project, go to properties and i will select Java Compiler from the left pane... it will show me which JDK my project should be compile-compatible with.. i have JDK 1.3, 1.4 and 5 installed .... it will list all of them in a combo... I selected the one i wanted...
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 22766359
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
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 74
Bot application - advice 3 58
java mysql insert application 14 41
Eclipse for Java EE development 2 43
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question