I have just installed new Maven into my new Fedora 17 64bit.
Details:
java -version
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)
javac -version
javac 1.6.0_32
echo $JAVA_HOME
/usr/java/jdk1.6.0_32
echo $JRE_HOME
/usr/java/jdk1.6.0_32/jre
echo $M2_HOME
/usr/local/maven/apache-maven-3.0.4
echo $M2
/usr/local/maven/apache-maven-3.0.4/bin
echo $PATH
/usr/local/maven/apache-maven-3.0.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/sbin:/usr/sbin:/usr/java/jdk1.6.0_32/bin:/home/bujaka/.local/bin:/home/bujaka/bin
which mvn
/usr/local/maven/apache-maven-3.0.4/bin/mvn
But mvn -version throws java.lang.ClassNotFoundException.
java.lang.ClassNotFoundException: org.apache.maven.cli.MavenCli
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.getMainClass(Launcher.java:145)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:267)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
P.S. I installed maven from apache site (not from fedora repos)
MavenCli class is in maven-embedder. Are you behind a proxy?
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<proxies>
<proxy>
<id>myproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.somewhere.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>*.google.com|ibiblio.org</nonProxyHosts>
</proxy>
</proxies>
...
</settings>
@See Maven Proxy Settings