1. Download Eclipse
Go to the eclipse downloads site
Which Eclipse version?
Choose Eclipse IDE for Java EE Developers and get the latest version. Find out if your computer is running a 32 or 64 bit version of the operating system. Here is how to find that out. Then select “Windows 32 bit” or “Windows 64 bit” depending on how your system is configured.
2. Install Eclipse
All you have to do to install Eclipse is to unzip the folder you downloaded and put the folder in a location of your choice. I named the folder “EclipseJEE-Indigo” and placed this folder inside my C: drive.
You can have as many different installation versions as you like! And, they can all access the same workspace, no problem.
3. Start Eclipse
Start Eclipse by double clicking on the purple Eclipse icon inside the unzipped folder “eclipse.exe” You create a shortcut and put the icon on the desktop if you like.
4. Configure Eclipse to use the Java JRE and JDK that you’ve installed
Before getting started configuring Eclipse, let’s first find the jre that we will be using. The JRE that we want is actually located in a folder inside our JDK installation! Although you might think it is located inside the folder called “jre7″ … it is actually in the other folder. Have a look inside
C: -> Program Files -> Java -> Jdk1.7.
See inside the Jdk1.7 folder there is a folder called “jre”. Now to make things easier, rename this “jre” folder to “jre7″ or “jre1.7″ to better help you distinguish different JRE versions inside Eclipse.
If you open Eclipse and create a new java project, you can try selecting the JRE 1.7 as one of the choices during the project setup phase. However, if you continue, you will find an error “Unbound classpath container.” Eclipse will complain about the installation of the JRE 1.7 Library because it has not been set up yet. So, let’s do that now.
Right click on the new project and select “Properties.” Then select “Java Build Path” and the “Libraries” tab. Remove the existing one with errors and go into “Add Library” and select “JRE System Library.” Then click “Installed JREs” and “Search…” and locate the jdk1.7 folder. Select the Jdk1.7 folder and click OK (don’t select the jre folder!). Now you should be able to select “jre7″ as the default workspace library.
Notice the errors have disappeared now, and you can start to create java classes. If you create another Java project, you won’t have to do that configuration again!
Note that Eclipse does NOT consult the JAVA_HOME variable. Although it has been recommended to modify the eclipse.ini file to include something like this:
this approach did not work for me with the latest version of Eclipse.