【发布时间】:2013-12-06 19:03:13
【问题描述】:
我正在尝试通过 java web start 使 swing-app 可再发行。我用 netbeans 7.4 构建 jar 和 jnlp。
通过网络下载应用程序时收到此消息。(抱歉西班牙语) 但它说 manifest.mf 不包含权限属性。
我没有使用受信任的证书(由 CA),我使用 netbeans 工具自己创建了密钥库。
在project.properties我放
# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
manifest.custom.codebase=http://150.1.1.32:8084/
# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
manifest.custom.permissions=all-permissions
manifest.file=manifest.mf
当我从主 jar 中看到构建 jar 清单后,所有依赖项 jar 都具有属性 all-permissions
Permissions: all-permissions
Created-By: 1.7.0_45-b18 (Oracle Corporation)
Main-Class: com.onix.sirf.gui.executors.SwingExecutor
Codebase: http://150.1.1.32:8084/
这是我的jnlp
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="http://150.1.1.32:8084/" href="sirf.jnlp" spec="1.0+">
<information>
<title>title</title>
<vendor>blabla</vendor>
<homepage href="http://www.blabla.com"/>
<description>Some description</description>
<description kind="short">HelloWorld</description>
</information>
<update check="always"/>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.7+"/>
<jar href="frontend.jar" main="true"/>
<jar href="lib/commons-lang3-3.1.jar"/>
<jar href="lib/jcalendar-1.4.jar"/>
<jar href="lib/log4j-1.2.17.jar"/>
<jar href="lib/swingx-all-1.6.4.jar"/>
-- there are some more libraries
<extension href="jnlpcomponent1.jnlp"/> -- here is one more library sqljdbc4.jar
</resources>
<application-desc main-class="com.onix.sirf.gui.executors.SwingExecutor">
</application-desc>
</jnlp>
还有jnlpcomponent1.jnlp
<jnlp codebase="http://150.1.1.32:8084/" href="jnlpcomponent1.jnlp" spec="1.0+">
<information>
<title>jnlpcomponent1</title>
<vendor>MSFTSIG</vendor>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jar href="lib/sqljdbc4.jar" download="eager"/>
</resources>
<component-desc/>
</jnlp>
【问题讨论】: