Issue:
I am getting the Maven error \"The JAVA_HOME environment variable is not defined correctly\" when I run through Inno setup batch execution. Howe
I struggled with the same issue, and the following worked for me.
Step 1: Check your JAVA_HOME setting. It may look something like:
JAVA_HOME="/usr/libexec/java_home"
Step 2: Update JAVA_HOME like so:
$ vim .bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
$ source .bash_profile
Step 3: In a new shell, check that the Maven command is now working properly:
$ mvn -version
If this fixed the problem, you should get back a response like:
Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800)
Maven home: /usr/share/maven
Java version: 1.7.0_05, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.2", arch: "x86_64", family: "mac"