我在 JNLP 的帮助下从网站上启动了我的java应用程序 . 但我面临文件上传和下载问题 . 如果我点击上传按钮,它不会给出任何回复 .
我的代码在下面
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0"
codebase="http://localhost:8080/"
href="apprun.jnlp">
<information>
<title>Run Desktop app</title>
<vendor>ACB </vendor>
</information>
<resources>
<jar href="apprun.jar"/>
<j2se version="1.6.10+" href="http://java.sun.com/products/autodl/j2se"
s java-vm-args="-Djava.net.preferIPv4Stack=true"/>
</resources>
<application-desc main-class="apprun.mainclass"/>
</jnlp>
这个apprun.jar是一个桌面应用程序 . 它有文件上传和下载功能 . 当我尝试它作为一个桌面应用程序,它的工作正常,但当我在 JNLP 概念中尝试它失败 . 文件上传窗口没有打开它没有显示任何错误,也没有显示任何响应 .
1 回答
你的jnlp文件坏了 .
1.)j2se标签中的 s 是什么?
<j2se version="1.6.10+" href="http://java.sun.com/products/autodl/j2se" s java-vm-args="-Djava.net.preferIPv4Stack=true"/>
2.)将
<j2se>
标记放在任何<jar>
标记之前