[java] eclipse, running my program with older JRE

Started by
4 comments, last by balla_the_king 18 years ago
Hi, I am using Eclipse. I have the problem that I want to develop one of my projects with old version of the JRE while the other projects with the latest version. Any ideas how to solve this? Having 2 computers, one with old JRE and one with new JRE is not an option.
Advertisement
Select Project->Properties and then open the Java Build Path section. Under 'Libraries' you can set the JDK you want to use for that project. You may also need to change some of the options under Java Compiler too.
I'm not an Eclipse user (I use netbeans), but I'm pretty sure that you can register other Java platforms within your IDE. At least it's possible with Netbeans, and I don't see a reason why Eclipse wouldn't have such feature.

Check the help files, it should be easy to do so (if available).

Son Of Cain

[Edit: I was beaten by OrangyTang =]
a.k.a javabeats at yahoo.ca
Go into menu "Project/Properties", select"Java Build Path" on the left side of the window, choose "Libraries" tab, and replace shown "JRE System Library" (and perhaps any other related library like "JDK Tools") by the older one.

Then choose "Java Compler" on the left side of the window, and pick the compiler compliance level suitable for the chosen JRE.


EDIT: OrangyTang was too fast ;)
You also need to tell Eclipse what JREs are on your machine. You do this with Window->Preferences->Java->Installed JREs
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
Thanks guy. Java and eclipse not my cup of tea obviosly :D

This topic is closed to new replies.

Advertisement