I was using Apache Maven 3.3.3, I put the code into the /opt directory. Then I run this command to make it works:
export PATH=/opt/apache-maven-3.3.3/bin:$PATH;
Then I run this one because JAVA_HOME wasn't defined correctly (was /usr/libexec/java_home, supposed to be /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home):
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
Now Maven work as expected.
Here comes the problem, it only works on that terminal window, when I use another window I have to run the two commands above again to make it work again, this is very annoying, is there a way to prevent this?
Thanks.