gpt4 book ai didi

windows - Build.xml 给出问题。 ."CreateProcess error=87, The parameter is incorrect"

转载 作者:可可西里 更新时间:2023-11-01 14:44:15 24 4
gpt4 key购买 nike

我试图在 Windows 环境中使用 ant 构建脚本来执行我的 java 程序。

但是我遇到了以下问题。这是在linux环境中工作的。

    [1] init:    compile:    stockquote:         [java] C:\wso2esb-4.0.0-SNAPSHOT\samples\axis2Client\build.xml:128: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_20\jr    e\bin\java.exe": CreateProcess error=87, The parameter is incorrect         [java]     at org.apache.tools.ant.taskdefs.Java.fork(Java.java:798)         [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:214)         [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)         [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)         [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)         [java]     at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)         [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)         [java]     at java.lang.reflect.Method.invoke(Method.java:597)         [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)         [java]     at org.apache.tools.ant.Task.perform(Task.java:348)         [java]     at org.apache.tools.ant.Target.execute(Target.java:390)         [java]     at org.apache.tools.ant.Target.performTasks(Target.java:411)         [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)         [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1368)         [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)         [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1251)         [java]     at org.apache.tools.ant.Main.runBuild(Main.java:809)         [java]     at org.apache.tools.ant.Main.startAnt(Main.java:217)         [java]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)         [java]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)         [java] Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_20\jre\bin\java.exe": CreateProcess error=87, The parameter is incorrect         [java]     at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)         [java]     at java.lang.Runtime.exec(Runtime.java:593)         [java]     at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862) 
   <target name="stockquote" depends="compile">
<java classname="samples.userguide.StockQuoteClient"
classpathref="javac.classpath" fork="true">
<sysproperty key="symbol" value="${symbol}"/>
<sysproperty key="mode" value="${mode}"/>
<sysproperty key="addurl" value="${addurl}"/>
-----------------------------------------------

<target name="init">
<mkdir dir="${class.dir}"/>
<mkdir dir="./../../work/temp/sampleClient"/>
<path id="javac.classpath">
<pathelement path="${class.dir}"/>
<pathelement path="../../lib"/>
<fileset dir="../../repository/components/plugins">
<include name="*.jar"/>
</fileset>

<fileset dir="../../lib">
<include name="*.jar"/>
</fileset>
<fileset dir="../../lib/endorsed">
<include name="*.jar"/>
</fileset>
<fileset dir="../../repository/components/extensions">
<include name="*.jar"/>
</fileset>
<fileset dir="../../repository/components/lib">
<include name="*.jar"/>
</fileset>
</path>
</target>

最佳答案

似乎您的 CLASSPATH 太长,Windows 无法处理。

谷歌“CreateProcess error=87,参数不正确”。另见 answer .

您需要缩短类路径。尝试仅包含 StockQuoteClient 的实际依赖项,而不包含所有“*.jar”条目。

关于windows - Build.xml 给出问题。 ."CreateProcess error=87, The parameter is incorrect",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9834627/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com