Solved

How to target JRE 1.5?

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

746 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

15 Experts available now in Live!

Get 1:1 Help Now