Solved

How to target JRE 1.5?

Posted on 2008-10-20
5
567 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

729 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