- Download both Java7 & Java8 and put them on different folders $JAVA_7 & $JAVA_8
- Include both versions on update-alternatives for java
- sudo update-alternatives --install "/usr/bin/java" "java" $JAVA_7/bin/java 2
- sudo update-alternatives --install "/usr/bin/java" "java" $JAVA_8/bin/java 1
- Include both versions on update-alternatives for java2
- sudo update-alternatives --install "/usr/bin/javac" "javac" $JAVA_7/bin/javac 2
- sudo update-alternatives --install "/usr/bin/javac" "javac" $JAVA_8/bin/javac 2
- For Changing default java :
- sudo update-alternatives --config java
- sudo update-alternatives --config javac
Comments