setting up Multiple Java Environments
OpenJdk 11 Installation and making it default
Recently i was checking some java 11 features and had a requirement to test some code in Java 11 and later wanted to switch back to java 1.8.
Below are the steps, i did my CentOS 7 system.
- I have the current version set as below:
2. I normally maintain my Environment variables in /etc/profile.d/setEnv.sh . Below are the contents cat’ed to the screen. ( Thanks to the stack overflow people for this shortcut to set JAVA_HOME path).
3. installed the OpenJDK 11 as shown below :
4. Once the installation of OpenJDK 11 is finished, we need to set the default java and javac as shown below.
make sure your Java is pointing to OpenJDK11 by running the version for both java and javac.