Solved

How to target JRE 1.5?

Posted on 2008-10-20
5
534 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDFBox - convert image to PDF, PDF resolution 3 118
Free Alternative to JIRA 4 91
maven project error 5 48
more than one jdk and one jre 1 34
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now