Search code examples
mavencygwinmaven-3

maven error when running in cygwin?


I have cygwin in Windows 7 and downloaded and installed maven "binaries" and have the following set

export JAVA_HOME=/cygdrive/c/java/jdk1.7.0_11
export MAVEN_HOME=/usr/apache-maven-3.0.5
export M2_HOME=/home/MyUser/.m2
export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH

$ which java
/cygdrive/c/java/jdk1.7.0_11/bin/java

$ java -version
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

$ which mvn
/usr/apache-maven-3.0.5/bin/mvn

$ mvn -version
Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher

I've looked at Maven error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher but it did not address my issue.

What did I miss?


Solution

  • Maven with Cygwin - Error: JAVA_HOME is not defined correctly

    The "alias mvn=mvn.bat" answer toward the bottom of above post worked for me. However, is this THE solution?