windows - Build.xml giver problem .. 'CreateProcess error=87, parameteren er forkert'

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg forsøger at udføre mit java program ved hjælp af ant build script i Windows miljø.


Men jeg får følgende problem. Dette arbejder i linux-miljø.


    [1] init:

    compile:

    stockquote:
         [java] C:wso2esb-4.0.0-SNAPSHOTsamplesaxis2Clientuild.xml:128: java.io.IOException: Cannot run program "C:Program FilesJavajdk1.6.0\_20jr
    einjava.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 FilesJavajdk1.6.0\_20jreinjava.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>

Bedste reference


Synes, at din CLASSPATH er for lang til, at Windows skal klare.


Google for 'CreateProcess error=87, parameteren er forkert'. Se også dette svar.


Du bliver nødt til at forkorte din klassepath. Prøv kun at inkludere de faktiske afhængigheder af StockQuoteClient og intet andet end alle '* .jar' -indgavene.