运行Ant项目时jdk1.7编译器出错

时间:2016-07-27 02:51:10

标签: java intellij-idea ant

当我在想法中运行ant项目时,我得到一些关于jdk编译器的错误。这是我第一次处理蚂蚁问题,我找不到问题所在?所以我想在这里得到一些帮助,任何建议都将受到赞赏。

感谢。

  

的build.xml

 <?xml version="1.0" encoding="GB2312"?>
<!-- ====================================================================== -->
<!--                                                                        -->
<!--                       UCPPS, Build                                      -->
<!--  This file used to deploy the xPortal and xTBS system                  -->
<!--                                                                        -->
<!-- ====================================================================== -->

<!--       UCPPS make file 
    Your should change the base dir of your local path
-->
<project name="Portal" default="war" basedir=".">
    <description>miguPCMS build file</description>

    <!-- set global properties for this build -->
    <!-- ====================================================================== -->
    <!--                                                                        -->
    <!--              Set the local  props                                   -->
    <!--                                                                        -->
    <!-- ====================================================================== -->
    <property environment="env" />
    <property name="BUILD_TARGET" value="miguPCMS" />
    <property name="COMPONENT_SRC_PATH" location="G:\workspace\1.5 Code\1.5.02 miguPCMS" />
    <!--location="G:\workspace2\miguPCMS" />-->
    <property name="JAVA_HOME" value="${env.JAVA_HOME}" />
    <!--<property name="PATCH_NUMBER" value="${env.PATCH_NUMBER}" />-->

    <!-- ===================================================================== -->
    <!--                                                                        -->
    <!-- Set props of this project                                              -->
    <!--                                                                        -->
    <!-- ====================================================================== -->
    <property name="BasePath" location="." />

    <property name="RELEASE_HOME" location="G:\workspace\1.5 Code\1.5.02 miguPCMS" />
    <property name="appPath" location="${RELEASE_HOME}/WebContent" />
    <property name="tempPath" location="${RELEASE_HOME}/src" />
    <property name="warFile" location="${RELEASE_HOME}/miguPCMS.war" />
    <target name="init" depends="">
        <!-- Create the build directory structure used by compile -->
        <mkdir dir="${RELEASE_HOME}" />
        <mkdir dir="${appPath}" />
        <mkdir dir="${tempPath}" />
        <mkdir dir="${tempPath}/com" />
        <mkdir dir="${tempPath}/reource" />
    </target>
    <target name="getjava" depends="init"
        description="Get source file from cc">
        <!-- Get xportal java files from vss -->
        <echo>Get xportal java files</echo>
        <copy todir="${tempPath}/com/">
            <fileset dir="${COMPONENT_SRC_PATH}/src/com">
                <include name="**/*.java" />
                <include name="**/*.properties" />
                <include name="**/*.xml" />
            </fileset>
        </copy>
        <copy todir="${tempPath}">
                    <fileset dir="${COMPONENT_SRC_PATH}/reourse">
                        <include name="**/*.java" />
                        <include name="**/*.properties" />
                        <include name="**/*.xml" />
                    </fileset>
                </copy>
    </target>
    <!-- Get all db_script from vss -->
    <target name="getlib" depends="getjava"
        description="Get source file from vss">

        <echo>Copy own lib files</echo>
        <copy todir="${appPath}">
            <fileset dir="${COMPONENT_SRC_PATH}/WebContent" excludes="*.doc" />
        </copy>
    </target>
    <path id="lib-classpath">
        <fileset dir="${appPath}/WEB-INF/lib">
            <include name="**/*.jar"/>
        </fileset>
    </path>
    <target name="compile" depends="getlib"
        description="compile all java code">
        <javac srcdir="${tempPath}" debug="true" encoding="UTF-8"
            destdir="${appPath}/WEB-INF/classes"  verbose="no" fork="yes"
            executable="${JAVA_HOME}" >
            <classpath refid="lib-classpath" />
        </javac>
        <copy todir="${appPath}/WEB-INF/classes">
                    <fileset dir="${COMPONENT_SRC_PATH}/src">
                        <include name="**/*.properties"/>
                        <include name="**/*.xml"/>
                    </fileset>
                    <fileset dir="${COMPONENT_SRC_PATH}/reourse">
                                    <include name="**/*.properties"/>
                                    <include name="**/*.xml"/>
                                </fileset>
        </copy>
    </target>

    <target name="war" depends="compile"
        description="Build the app war file,">
        <jar destfile="${warFile}" basedir="${appPath}"
            includes="**/*.*" index="true" />
        <echo>clean up all</echo>
        <delete dir="${tempPath}" />
        <delete dir="${appPath}" />
    </target>
</project>
  

这是控制台日志

G:\migu\1.5.02 miguPCMS\build\build.xml:84: Error running D:\Programs\jdk1.7 compiler
    at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:508)
    at org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.java:61)
    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1159)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:935)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.Main.start(Main.java:198)
    at org.apache.tools.ant.Main.main(Main.java:286)
    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 com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:30)
Caused by: java.io.IOException: Cannot run program "D:\Programs\jdk1.7": CreateProcess error=5, ¾ܾø·Ã
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
    at java.lang.Runtime.exec(Runtime.java:617)
    at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
    at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
    at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
    at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:505)
    ... 24 more
Caused by: java.io.IOException: CreateProcess error=5, ¾ܾø·Ã
    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:1022)
    ... 29 more
G:\migu\1.5.02 miguPCMS\build\build.xml:84: Error running D:\Programs\jdk1.7 compiler
    at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:508)
    at org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.java:61)
    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1159)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:935)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.Main.start(Main.java:198)
    at org.apache.tools.ant.Main.main(Main.java:286)
    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 com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:30)
Caused by: java.io.IOException: Cannot run program "D:\Programs\jdk1.7": CreateProcess error=5, ¾ܾø·Ã
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
    at java.lang.Runtime.exec(Runtime.java:617)
    at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
    at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
    at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
    at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:505)
    ... 24 more
Caused by: java.io.IOException: CreateProcess error=5, ¾ܾø·Ã
    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:1022)
    ... 29 more
G:\migu\1.5.02 miguPCMS\build\build.xml:84: Error running D:\Programs\jdk1.7 compiler
    at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:508)
    at org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.java:61)
    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1159)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:935)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.Main.start(Main.java:198)
    at org.apache.tools.ant.Main.main(Main.java:286)
    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 com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:30)
Caused by: java.io.IOException: Cannot run program "D:\Programs\jdk1.7": CreateProcess error=5, ¾ܾø·Ã
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
    at java.lang.Runtime.exec(Runtime.java:617)
    at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
    at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
    at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
    at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:505)
    ... 24 more
Caused by: java.io.IOException: CreateProcess error=5, ¾ܾø·Ã
    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:1022)
    ... 29 more
  

我的JAVA_HOME   enter image description here

0 个答案:

没有答案