简体   繁体   中英

Problems with Maven installation

I am trying to install Maven on a Mac following the instructions here;

http://maven.apache.org/download.cgi#Installation_Instructions .

However I couldn't figure out how to

Make sure that JAVA_HOME is set to the location of your JDK, eg export JAVA_HOME=/usr/java/jdk1.7.0_51 and that $JAVA_HOME/bin is in your PATH environment variable.

My Java JDK is stored on desktop, so should I use the command?

export JAVA_HOME=/users/alex/desktop/jdk1.7.0_45

After I've done that, should the JAVA_HOME/bin be in my path environment variable?

It did work. The error message when I run maven --version says

Error: JAVA_HOME is not defined correctly. We cannot execute /users/alex/desktop/jdk1.7.0_45/bin/java

I am quite confused with the whole process. Many thanks for your help in advance. Really appreciate it.

The issue with your steps are these environment variables are not permanent in the system, paths will only be set to the current terminal. You should set this globally. To do this refer to this answer or this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM