Google Analytics

Search

To search for specific articles you can use advanced Google features. Go to www.google.com and enter "site:darrellgrainger.blogspot.com" before your search terms, e.g.

site:darrellgrainger.blogspot.com CSS selectors

will search for "CSS selectors" but only on my site.


Wednesday, February 17, 2010

multiple versions of Java for Eclipse

If you are using Eclipse you can use different version of Java to run your applications. When you create a new Java project, one of the settings is to select a JRE. There is also a link to configure the JREs.

First thing you will need is multiple JREs. If you go to http://java.sun.com/products/archive/ you should be able to find different versions of Java for your computer. You are mostly interested in the Java Platform Standard Edition (Java SE) and Java 2 Platform Enterprise Edition (J2EE). Download and install a few. I usually install them in C:\ on Windows so they are easy to find and unaffected by Windows Update.

In Eclipse, if you go to the link to configure JREs you will come to a dialog with a list of JREs (probably only one maybe two entries) and an Add... button. Click the Add... button, select Standard VM, then browse to the home of the JRE you installed. If you installed the JRE into C:\jre142_5 then this is the JRE home you are looking for. If you installed a JDK it is probably something like C:\jdk142_5.

Once you have added all the different JREs and JDKs you have installed, you can use them in new and existing projects.

For a new project, during the setup wizard you can select a project specific JRE from the list of JREs you have identified for the workspace.

For an existing project, right click on the Project name in the Package Explorer. From the menu select Build Path->Configure Build Path... option. In the dialog which appears you should see a list of Libraries for the project. One of the entries will be the JRE or JDK. Select it then click the Edit... button. On the dialog which appears you can select one of the JRE/JDKs you just added to the system.

No comments: