gpt4 book ai didi

java - 当我编译 JNLP 时出现 package javax.jnlp does not exist 错误

转载 作者:行者123 更新时间:2023-11-30 07:23:08 29 4
gpt4 key购买 nike

我正在使用构建文件来编译我的项目。我收到 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,我已经完成了。如何解决?

谢谢

最佳答案

猜测是这样的:

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

应该是

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

“lib”,而不是“ib”

关于java - 当我编译 JNLP 时出现 package javax.jnlp does not exist 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12209849/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com