我刚刚将新的 Maven 安装到我的新 Fedora 17 64 位。
细节:
java版本
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-版本
javac 1.6.0_32
回声 $JAVA_HOME
/usr/java/jdk1.6.0_32
回声 $JRE_HOME
/usr/java/jdk1.6.0_32/jre
回声 $M2_HOME
/usr/local/maven/apache-maven-3.0.4
回声 $M2
/usr/local/maven/apache-maven-3.0.4/bin
回声 $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
哪个MVN
/usr/local/maven/apache-maven-3.0.4/bin/mvn
但是 mvn -version 抛出 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)
PS我从apache站点安装了maven(不是从fedora repos)