无法在 windows 7 中 运行 jetty-maven-plugin

Cannot run jetty-maven-plugin in windows 7

我在 windows 的 运行 码头遇到问题。我从 eclipse 添加了 jetty 插件,但它发生了错误:

[WARNING] Error injecting: org.eclipse.jetty.maven.plugin.JettyRunMojo
java.lang.TypeNotPresentException: Type org.eclipse.jetty.maven.plugin.JettyRunM
ojo not present
        at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:115
)
        at org.eclipse.sisu.space.NamedClass.load(NamedClass.java:46)
        at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClas
s.java:48)
        at com.google.inject.internal.ProviderInternalFactory.provision(Provider
InternalFactory.java:86)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.prov
ision(InternalFactoryToInitializableAdapter.java:54)
        at com.google.inject.internal.ProviderInternalFactory.call(ProviderInt
ernalFactory.java:70)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.p
rovision(ProvisionListenerStackCallback.java:113)
        at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanSchedul
er.java:176)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.p
rovision(ProvisionListenerStackCallback.java:122)
        at com.google.inject.internal.ProvisionListenerStackCallback.provision(P
rovisionListenerStackCallback.java:68)
        at com.google.inject.internal.ProviderInternalFactory.circularGet(Provid
erInternalFactory.java:68)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(
InternalFactoryToInitializableAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.call(InjectorImpl.java:10
09)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.ja
va:1059)
        at com.google.inject.internal.InjectorImpl.get(InjectorImpl.java:1005)

        at com.google.inject.Scopes.get(Scopes.java:59)
        at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)

        at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:5
1)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai
ner.java:263)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContai
ner.java:255)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfigu
redMojo(DefaultMavenPluginManager.java:464)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:119)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/maven/plugi
n/JettyRunMojo : Unsupported major.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access[=12=]0(URLClassLoader.java:58)
        at java.net.URLClassLoader.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(Cl
assRealm.java:401)
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(
SelfFirstStrategy.java:42)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadCl
ass(ClassRealm.java:271)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm
.java:254)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm
.java:239)
        at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:107
)
        ... 41 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.836 s
[INFO] Finished at: 2015-01-23T10:20:44+07:00
[INFO] Final Memory: 7M/18M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.2.7.v20150
116:run (default-cli) on project WSFile: Execution default-cli of goal org.eclip
se.jetty:jetty-maven-plugin:9.2.7.v20150116:run failed: Unable to load the mojo
'run' in the plugin 'org.eclipse.jetty:jetty-maven-plugin:9.2.7.v20150116' due t
o an API incompatibility: org.codehaus.plexus.component.repository.exception.Com
ponentLookupException: org/eclipse/jetty/maven/plugin/JettyRunMojo : Unsupported
 major.minor version 51.0
[ERROR] -----------------------------------------------------

你们知道怎么解决吗?这似乎发生在 0.9.x 版本的码头上。但我不知道为什么会这样。我认为这是 windows 中的锁定文件问题,但似乎不可能。所以有人请帮助我,谢谢

如果检查堆栈跟踪,您会发现以下错误消息。这意味着在编译和 运行 时使用了不同的 jdk。请检查 jdk 版本

Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/maven/plugi
n/JettyRunMojo : Unsupported major.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)