Not able to switch java home properly in mac
Not able to switch java home properly in mac I have two versions of Java in my mac and I am trying to switch from 1.8 to 1.7 for compiling one of my project which has 1.7 specific contents. Though I ran the following commands in the terminal: $ alias setJdk1.7='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)' $ setJdk1.7 With that, I can see the proper version in java -version and mvn -version. $ java -version java version "1.7.0_181" Java(TM) SE Runtime Environment (build 1.7.0_181-b09) Java HotSpot(TM) 64-Bit Server VM (build 24.181-b09, mixed mode) $ mvn -version Apache Maven 3.0.5 (...) Maven home: *mvn path* Java version: 1.7.0_181, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_181.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.13.5", arch: "x86_64", family: "mac" However, the /usr/libexec/java_home still seems to be pointing to th...