The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
Rich Internet applications (RIAs) are downloaded from a web site when the user tries to access them. 当用户尝试访问富Internet应用程序(RIA)时,会从网站下载这些应用程序。(RIAs can be cached after the initial download to improve performance). (初始下载后可以缓存RIA以提高性能)。The time taken to download a RIA depends on the size of the RIA's JAR file. 下载RIA所需的时间取决于RIA JAR文件的大小。Larger JAR files take longer to download.较大的JAR文件下载时间较长。
You can reduce the download time of your RIA by applying the following techniques:通过应用以下技术,您可以减少RIA的下载时间:
pack200
tool.pack200
工具压缩RIA的JAR文件。The following steps describe how to create and deploy a compressed JAR file for a signed RIA.以下步骤描述了如何为签名RIA创建和部署压缩JAR文件。
--repack
option. --repack
选项规范化JAR文件。This step ensures that the security certificate and JAR file will pass verification checks when the RIA is launched.此步骤确保安全证书和JAR文件在RIA启动时通过验证检查。
pack200 --repack DynamicTreeDemo.jar
jarsigner -keystore myKeyStore DynamicTreeDemo.jar me
myKeyStore
is the name of the keystore and me
is the alias for the keystore.myKeyStore
是密钥库的名称,me
是密钥库的别名。pack200 DynamicTreeDemo.jar.pack.gz DynamicTreeDemo.jar
jnlp.packEnabled
property to true
in the RIA's JNLP file. jnlp.packEnabled
属性设置为true
。<resources> <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" max-heap-size="128m" /> <jar href="DynamicTreeDemo.jar" main="true"/> <property name="jnlp.packEnabled" value="true"/> <!-- ... --> </resources>
When the 当在JNLP文件中设置了jnlp.packEnabled
property is set in the JNLP file, the Java Plug-in software looks for the compressed JAR file with the .pack.gz
extension (for example, DynamicTreeDemo.jar.pack.gz
). jnlp.packEnabled
属性时,Java插件软件将查找具有.pack.gz
扩展名的压缩JAR文件(例如,DynamicTreeDemo.jar.pack.gz
)。If found, the Java Plug-in software automatically unpacks and loads the JAR file. 如果找到,Java插件软件会自动解压缩并加载JAR文件。If a file with the 如果找不到具有.pack.gz
extension is not found, then the Java Plug-in software attempts to load the regular JAR file (for example, DynamicTreeDemo.jar
)..pack.gz
扩展名的文件,那么Java插件软件将尝试加载常规JAR文件(例如,DynamicTreeDemo.jar
)。
jnlp.packEnabled
property. jnlp.packEnabled
属性。