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

This command will output the location of java installation directory something like this depending upon the version of jdk installed
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: