


To verify the configuration type the following command in the terminal window mvn -version and you will get the following output. The JAVAHOME environment variable is not defined correctly This environment. Enter JREHOME as variable name and C:\Program Files\Java\jre as Value. Next add M2 environment variable to path. Enter JAVAHOME as variable name and C:\Program Files\Java\jdk as Value. Next is to add M2 environment variable, type the following command in the terminal window.ģ. Add M2_HOME environment variable by typing the following command in the terminal window, make sure to give the correct path of Maven unzip folder.Įxport M2_HOME=/usr/local/opt/apache-mavenĢ.You can type java -version in the terminal window to check if JDK is installed or not.
#Check if java_home variable is set for maven mac mac os#
We can install Maven on Mac OS using a package manager such as HomeBrew or through XCode Command Line Tools. Note: I also tried creating and using the /.bashrc file, but that didn’t work (Mac OS 10.6.2), while /.bashprofile worked as expected.

