14 August 2014

Working with multiple jdk's on your local

I installed multiple jdk's on my local today. Played around a bit and figured out this is how I can easily switch between them!

> java -version:1.7 -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b19)

Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)


> java -version:1.8 -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)

Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)


If I want to use specific java version to run my eclipse, I will have to set the "-vm" variable in the eclipse.ini file like so:


-vm
C:\Program Files\Java\jdk1.8.0_11\bin\javaw.exe

Reference: 
1. multipe java on stackoverflow 
2. Eclipse - Specifying the JVM