Ant Java Lang类未发现例外



我是蚂蚁的新手,但是我有一般的理解。我只是无法工作。

<?xml version="1.0"?>
<project name="Ser321 Assignment 3 Java Movie Library with Ant build file and API support."
         default="targets" basedir="."
         xmlns:dn="antlib:org.apache.ant.dotnet"
         xmlns="antlib:org.apache.tools.ant"
         xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks">
   <property name="src.dir" value="src"/>
   <property name="lib.dir" value="lib" />
   <property name="build" value="classes"/>
   <property name="bin" value="bin"/>
   <property name="obj" value="obj"/>
   <property environment="env"/>
   <property name="user" value="${env.USERNAME}"/>
   <target name="targets">
      <echo message="Targets are clean, prepare, build, execute, and targets"/>
   </target>
   <path id="compile.classpath">
      <pathelement location="${build}"/>
   </path>
   <path id="external.classpath">
      <pathelement location="${lib.dir}/json.jar"/>
   </path>
   <target name="prepare">
      <mkdir dir="${build}" />
      <mkdir dir="${bin}"/>
      <mkdir dir="${obj}"/>
   </target>
   <target name="clean">
      <delete dir="${build}" failonerror="false"/>
      <delete dir="${bin}" failonerror="false"/>
      <delete dir="${obj}" failonerror="false"/>
   </target>
   <target name="build" depends="prepare">
      <javac srcdir="${src.dir}"
             includeantruntime="false"
             destdir="${build}">
         <classpath refid="external.classpath"/>
      </javac>
   </target>
   <target name="execute.jar" depends="build"
           description="Run the program">
         <java classname="Main" fork="yes">
           <classpath refid="compile.classpath"/>
         </java>
   </target>
</project>

这给了我的类文件夹作为下一个文件夹,然后在那里,我有3个课程。但是,它一直说找不到课,我不知道我在做什么错。

弄清楚了。我有时是空头。

<target name="execute.jar" depends="build"
       description="Run the program">
     <java classname="movie.Main" fork="yes"> //added movie.main instead of Main
       <classpath refid="compile.classpath"/>
     </java>

相关内容

  • 没有找到相关文章

最新更新