When editing JRE System Library item in Java Build Path we can choose among items in Environments or we can pick Alternate JRE (Installed JREs).
In my case, in installed JREs I have jdk1.6.0_25 and jre6.
What is the difference? And when should I reference one versus another one.
Thanks.
In Eclipse, there isn’t a lot of difference if you are using the Eclipse compiler (ecj) to compile and build your Java projects. However, not all plugins of Eclipse can run on ecj alone. For example, if you use Maven within Eclipse, you’ll need access to a JDK; a JRE is insufficient in such a case. The same goes for WTP.
Also, the JDK usually is installed with the sources and Javadocs, so autocomplete and tooltip documentation tends to be more thorough with a JDK than with a JRE. This can be fixed by adding a separate Java API docs zip/jar.
I believe the above points are sufficient enough to infer that using a JDK is usually better than using a JRE, except for plain Java projects.