Solved

How to target JRE 1.5?

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

739 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