我正在使用JDK8在虚拟框中运行maven 3.3.9 当我从终端运行'mvn'命令时,我收到以下错误:
constituent[25]: file:/usr/share/maven/lib/guice.jar
constituent[26]: file:/usr/share/maven/lib/eclipse-aether-impl.jar
constituent[27]: file:/usr/share/maven/lib/guava.jar
constituent[28]: file:/usr/share/maven/lib/commons-lang3.jar
constituent[29]: file:/usr/share/maven/lib/wagon-http-shaded.jar
constituent[30]: file:/usr/share/maven/lib/javax.inject.jar
constituent[31]: file:/usr/share/maven/lib/maven-compat-3.x.jar
constituent[32]: file:/usr/share/maven/lib/commons-io.jar
constituent[33]: file:/usr/share/maven/lib/plexus-interpolation.jar
constituent[34]: file:/usr/share/maven/lib/commons-lang.jar
constituent[35]: file:/usr/share/maven/lib/plexus-utils.jar
constituent[36]: file:/usr/share/maven/lib/plexus-cipher.jar
constituent[37]: file:/usr/share/maven/lib/wagon-provider-api.jar
constituent[38]: file:/usr/share/maven/lib/wagon-http-shared.jar
constituent[39]: file:/usr/share/maven/lib/eclipse-aether-transport-wagon.jar
constituent[40]: file:/usr/share/maven/lib/sisu-plexus.jar
constituent[41]: file:/usr/share/maven/conf/logging/
---------------------------------------------------
Exception in thread "main" java.lang.NoClassDefFoundError: javax/inject/Provider
at org.apache.maven.cli.MavenCli.container(MavenCli.java:545)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:281)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: javax.inject.Provider
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 11 more
我阅读了几个论坛,他们都建议升级JDK,但我已经使用了最新版本。 :-(
有人可以指导我解决这个问题。
Windows机器上的相同版本使用相同的JDK
工作正常