Friday, March 9, 2018

How to Set Path for Java In Mac

First step is to find where is java installed. For that open terminal and type the below command

/usr/libexec/java_home
This command will output the location of java installation directory something like this depending upon the version of jdk installed
/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
Next step is to set PATH environment variable. Execute the below command in Terminal
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
export PATH=${PATH}:$JAVA_HOME/bin


 
 

No comments: