2

プロジェクトをコンパイルするためにビルドファイルを使用しています。エラーが発生してpackage javax.jnlp does not existいます。私のJavaファイルにはエラーがありません。javaws.jarプロジェクトのビルド パスに追加しました。

私のビルドファイルコード

<!-- Build file for the project. -->
<project basedir="." default="launch" name="OPRS_JNLP">

  <target name="properties">
    <property name="build" value="build" />
    <property name="dist" value="dist" />
    <property name="src" value="src" />

    <property
      name="classpath"
      value="${java.home}/jre/lib/javaws.jar" />
  </target>

  <target
    name="compile"
    depends="properties"
    description="Compile the project" >
    <mkdir dir="${build}/share" />
    <javac
      debug="on"
      destdir="${build}/share"
      srcdir="com/abhibus/oprs"
      source="1.6"
      classpath="${classpath}" />
    <copy todir="${build}/share">
      <fileset dir="com/abhibus/oprs">
        <exclude name="**/CVS" />
        <exclude name="**/*.java" />
      </fileset>
    </copy>
  </target>

  <target
    name="dist"
    depends="compile"
    description="Create project distribution" >
    <mkdir dir="${build}/jar" />
    <mkdir dir="${build}/jar/lib" />
    <jar destfile="${build}/jar/apsrtcoprs.jar">
      <fileset dir="${build}/share">
        <include name="**/*.class" />
      </fileset>
    </jar>
  </target>

  <target
    name="make-launch-file"
    depends="properties"
    description="Copies and configures the launch file" >
    <copy todir="${build}/jar" >
      <fileset dir="${src}/conf" >
        <include name="**/*.jnlp" />
      </fileset>
    </copy>
  </target>

  <target
    name="launch"
    depends="dist, make-launch-file"
    description="Launch the project using webstart">
    <exec executable="javaws"
      dir="${build}/jar">
      <arg line="-codebase file:. file:./apsrtcoprs.jnlp" />
    </exec>
  </target>

  <target
    name="uninstall"
    depends="properties"
    description="Uninstall the project from the webstart cache">
    <exec executable="javaws">
      <arg
        line="-uninstall http://localhost:9999/apsrtcoprs.jnlp"
        />
    </exec>
  </target>

  <target name="clean"
    depends="properties"
    description="Clean all generated files">
      <delete dir="${build}" />
      <delete dir="${dist}" />
  </target>
</project>

何がうまくいかないのですか?フォーラムを検索すると、すでに行ったjavaws.jarを含めるように言われました。これを解決するには?

ありがとう

4

2 に答える 2

4

推測では、これは:

value="${java.home}/jre/ib/javaws.jar" />

する必要があります

value="${java.home}/jre/lib/javaws.jar" />

「ib」ではなく「lib」

于 2012-08-31T06:25:41.733 に答える
0

これはやや奇妙です。クラスパス値をとして変更し、/usr/java/jdk1.6.0_24/jre/lib/javaws.jarコンパイルしています。アンドリューとジョンに助けてくれてありがとう。

于 2012-08-31T07:03:12.627 に答える