I want to install JDK 1.5 and 1.6 on XP, is it possible? how to do it
Also, I am using Eclipse how to setup using different JDK for different projects?
thanks.
You can install multiple JDK and JRE but each one should to have its own separate folder, the default should be usually ok.
Or, suppose you are working on multiple projects, some of which use Java 8 and some of which are new projects using Java 11. So, in order to work on both of these projects, you will need to install multiple versions of the JDK on your machine and be able to switch between them.
You may install different JDKs easily: just specify different folders.
You can setup the installed JDKs in Eclipse Window/Preferences/Installed JREs
You can pick the JDK and Java version for every single project in Project/Properties/Java Compiler
I have solved this by creating batch files for different Java versions.
Java 8.bat
@echo off echo Setting JAVA_HOME set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121 echo setting PATH set PATH=%JAVA_HOME%\bin;%PATH% echo Display java version java -version
Java 10.bat
@echo off echo Setting JAVA_HOME set JAVA_HOME=C:\Program Files\Java\jdk-10.0.2 echo setting PATH set PATH=%JAVA_HOME%\bin;%PATH% echo Display java version java -version
Why? There is an option (can't remember where exactly - right-click on your project) that allows you to set the target JDK level. I use this when developing GWT applications.
Try using sdkman
. Even though the installing on Windows is a bit 'tricky' but there are several options.
https://sdkman.io/install
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