我已升级到 java 7,无法通过 Java Web Start 启动 Swing 应用程序。它说缺少 3 个 list 属性:“代码库”、“权限”和“应用程序名称”。
我在创建 .jar 时将这些缺失的属性添加到 list 文件中并对其进行签名。我终于可以在 jar 里看到这些属性了。但是,当从 Web Start 启动 Swing GUI 时,它显示相同的错误 3 list 属性丢失。
最佳答案
您需要更新 JNLP 中的这些项目而不是 jar,因为您是通过 webstart 启动的。
示例来自:http://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html
<jnlp spec="1.0+" codebase=
"http://docs.oracle.com/javase/tutorialJWS/samples/deployment/webstart_ComponentArch_DynamicTreeDemo"
href="dynamictree_webstart.jnlp">
<information>
<title>Dynamic Tree Demo</title>
<vendor>Dynamic Team</vendor>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.7+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="DynamicTreeDemo.jar"
main="true" />
</resources>
<application-desc
name="Dynamic Tree Demo Application"
main-class=
"webstartComponentArch.DynamicTreeApplication"
width="300"
height="300">
</application-desc>
<update check="background"/>
</jnlp>
对于权限,您可能需要安全标记,以下是有关该标记的文章:http://lopica.sourceforge.net/ref.html#security
By default every application runs in a restricted execution environment (aka sandbox). If an app runs in a secure sandbox, it must follow these restrictions:
No access to local disk. All your jars must be downloaded from the same host. Note, however, that you can download extensions and JREs from any host as long as they are signed and trusted. Network connections are allowed only to host from which your jars were downloaded. ("Phone home restriction.") No security manager can be installed. No native libraries (not even in extensions). Limited access to system properties. (The application has read/write access to all system properties defined in the jnlp file, as well as read-only access to the same set of properties as applets (see System Properties Available for Unsigned Apps for a complete list).) If you specify all-permissions, the app can do whatever it wants and has full access to the user's machine and local network.
Contents
all-permissions?, j2ee-application-client-permissions?
<security>
<all-permissions/>
</security>
关于Java 7 Web 启动问题与 list 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20374376/