整个项目一直可以正常工作,直到出现此编译错误。谷歌搜索解决方案无济于事。完整的错误消息和IntelliJ JAVA_HOME
设置如下:
JAVA_HOME = C:\ Program Files \ Java \ jdk1.7.0_80
编译来自mvn clean install -X
的错误消息:
> t\admin-5.0.0-NG-SNAPSHOT -localWorkers 4 -XfragmentCount -1 -sourceLevel auto -gen
D:\project\dk\com.a.b.c.admin............;D:\project\dk\com.a.b.c.ui.......
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.850 s
[INFO] Finished at: 2019-02-27T23:31:03+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-
plugin:2.7.0:compile (gwtcompile) on project admin: Failed to execute command line :
[ERROR] [-XX:MaxPermSize=2048m, -Xmx4096m, -classpath,
D:\project\dk\com.a.b.c.admin............;D:\project\dk\com.a.b.c.ui.......]:
Error while executing process. Cannot run program "C:\Program
Files\Java\jdk1.7.0_80\jre\bin\java": CreateProcess error=206,
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.7.0:compile (gwtcompile) on project admin: Failed to execute command line :
[-XX:MaxPermSize=2048m, -Xmx4096m, -classpath,
D:\project\dk\com.a.b.c.admin............;D:\project\dk\com.a.b.c.ui.......]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:606)
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: org.apache.maven.plugin.MojoExecutionException: Failed to execute
command line :
[-XX:MaxPermSize=2048m, -Xmx4096m, -classpath,
D:\project\dk\com.a.b.c.admin............;D:\project\dk\com.a.b.c.ui.......]
at org.codehaus.mojo.gwt.shell.CompileMojo.compile (CompileMojo.java:552)
at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute (CompileMojo.java:415)
at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute
(AbstractGwtShellMojo.java:159)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:606)
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: org.codehaus.mojo.gwt.shell.JavaCommandException: Failed to
execute command line :
[-XX:MaxPermSize=2048m, -Xmx4096m, -classpath,
D:\project\dk\com.a.b.c.admin............;D:\project\dk\com.a.b.c.ui.......]
at org.codehaus.mojo.gwt.shell.JavaCommand.execute (JavaCommand.java:342)
at org.codehaus.mojo.gwt.shell.CompileMojo.compile (CompileMojo.java:548)
at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute (CompileMojo.java:415)
at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute
(AbstractGwtShellMojo.java:159)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:606)
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: org.codehaus.plexus.util.cli.CommandLineException: Error while
executing process.
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:675)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable
(CommandLineUtils.java:134)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine
(CommandLineUtils.java:105)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine
(CommandLineUtils.java:74)
at org.codehaus.mojo.gwt.shell.JavaCommand.execute (JavaCommand.java:322)
at org.codehaus.mojo.gwt.shell.CompileMojo.compile (CompileMojo.java:548)
at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute (CompileMojo.java:415)
at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute
(AbstractGwtShellMojo.java:159)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:606)
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.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_80\jre\bin\java": CreateProcess error=206, ▒ļ▒▒▒▒▒▒▒չ▒▒̫▒▒▒▒
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1047)
at java.lang.Runtime.exec (Runtime.java:617)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:655)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable
(CommandLineUtils.java:134)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine
(CommandLineUtils.java:105)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine
(CommandLineUtils.java:74)
at org.codehaus.mojo.gwt.shell.JavaCommand.execute (JavaCommand.java:322)
at org.codehaus.mojo.gwt.shell.CompileMojo.compile (CompileMojo.java:548)
at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute (CompileMojo.java:415)
at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute
(AbstractGwtShellMojo.java:159)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:606)
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.io.IOException: CreateProcess error=206, ▒ļ▒▒▒▒▒▒▒չ▒▒̫▒▒▒▒
at java.lang.ProcessImpl.create (Native Method)
at java.lang.ProcessImpl.<init> (ProcessImpl.java:385)
at java.lang.ProcessImpl.start (ProcessImpl.java:136)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1028)
at java.lang.Runtime.exec (Runtime.java:617)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:655)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLineAsCallable
(CommandLineUtils.java:134)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine
(CommandLineUtils.java:105)
at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine
(CommandLineUtils.java:74)
at org.codehaus.mojo.gwt.shell.JavaCommand.execute (JavaCommand.java:322)
at org.codehaus.mojo.gwt.shell.CompileMojo.compile (CompileMojo.java:548)
at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute (CompileMojo.java:415)
at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute
(AbstractGwtShellMojo.java:159)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:606)
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)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
错误中有一个关键消息Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_80\jre\bin\java": CreateProcess error=206
。我确定我设置了正确的JAVA_HOME
地址。
有解决此问题的主意吗? 预先感谢。
答案 0 :(得分:0)
您的intellij可能无法在C:\ Program Files \ Java \ jdk1.7.0_80 \ jre \ bin \ java上读取。 您可以尝试以下操作,其中之一应该可以工作
1)将intellij作为Administartor运行,然后运行maven build。
OR
2)右键单击Java文件夹>“属性”>“安全性”>检查已登录用户的读/写权限,然后授予“完全权限”。 此外,在属性的“常规”标签中,还会删除只读内容。
OR
3)将Java移动到其他驱动器或位置,然后尝试使用。