我正在使用構建文件來編譯我的項目。我得到package javax.jnlp does not exist
錯誤。我的java文件沒有任何錯誤。我已將javaws.jar
添加到我的項目構建路徑中。當我編譯JNLP時,javax.jnlp程序包不存在錯誤
我的構建文件代碼
<!-- 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,我已經做了。如何解決這個問題?
感謝
檢查路徑。這裏可以通過將'C:\ Program Files(x86)\ Java \ jre6'的'java.home'添加到'/ lib/javaws.jar'中。更直接地,嘗試'$ {java.home}/lib/javaws.jar' –
我的Java hoem指向/usr/java/jdk1.6.0_24/,實際路徑是/usr/java/jdk1.6.0_24/ jre/lib,我有javaws.jar。我在這裏提到了同樣的道路。 –
修改我的類路徑後,它編譯好。但是,當我啓動'執行失敗:java.io.IOException:無法運行程序「javaws」(在目錄「/ sreekanth/ProjectsCXF/JavaWebStartTest/src/build/jar」):java.io.IOException:error = 2,沒有這樣的文件或目錄。 ? –