I am using intellij and my M2 and M2_HOME are set and are in .bash_profile, however I have this error :
No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system
any idea why it does not work with environment variable ?
This error message means that the folder named "maven" that you've chosen does not contain maven installation. The default Maven Home Directory was the m2 folder. Normally, by default you'll see either the embeded maven or the value of M2_HOME environment variable.
From the main menu select File | Settings/Preferences | Build, Execution, Deployment |Build Tools | Maven. On the Maven settings page, in the Maven home directory field, specify the location of the Maven custom version installation.
Set M2_HOME & PATHCreate an environment variable named M2_HOME which refers to directory where maven was untarred/ unzipped. and then add this variable to PATH environment variable. $>export PATH=$M2_HOME/bin:$PATH. Click OK, then Edit the 'Path' user variable to add M2_HOME\bin folder in it.
Selecting "Bundled Maven" instead of "Maven wrapper" fixed the issue for me.
On Mac (I am using macOS Sierra 10.12.1, IntelliJ IDEA 2016.2).
Choose command+, , choose Build, Execution, Deployment, choose Build Tools, then press Maven
then set Maven home directory: correctly
for example: /Users/donhuvy/Documents/program_files/apache-maven-3.3.9
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With