I need to write a project that's only compatible with Java 1.5. I have Java 1.6 installed. Is there some form of backwards compatibility to get Eclipse to compile with 1.5?
Do I have to install Java 1.5 to get it to show here? Or maybe there is another way?
.
A Java 11 JRE is recognized by Eclipse for launching. It can be added from the Window > Preferences > Java > Installed JREs > Add... page. It can also be added from the Package Explorer using the project's context menu.
Click on the Add Library button. It brings your screen to point to the Java location.
Select "Directory", button right besides JRE home and point to the installed folder location.
Even though you want to just 1.5 compiler project, you can achieve it by changing compiler settings in Eclipse instead of removing 1.6 JRE and add 1.5 JRE.
GOTO -->JAVA--Compiler---> and change compiler level to `1.5` instead of `1.6`
As davidfmatheson suggested,
Just be careful, especially if you're setting this up for a team of people to work on. If anyone uses anything that is new or changed in 1.6, it will compile, but not run in an environment with JRE 1.5.
Click on the Window tab in Eclipse, go to Preferences and when that window comes up, go to Java → Installed JREs → Execution Environment and choose JavaSE-1.5. You then have to go to Compiler and set the Compiler compliance level.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With