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发行说明。
Deployment Best Practices部署最佳做法
You can improve the user experience of your rich Internet application (RIA) using the best practices described in this topic.您可以使用本主题中描述的最佳实践来改善富Internet应用程序(RIA)的用户体验。
Sign the RIA using a certificate from a recognized certificate authority. 使用来自公认证书颁发机构的证书对RIA进行签名。Make sure that all artifacts are signed, and that the certificate has not expired. 确保所有工件都已签名,并且证书尚未过期。See Signing and Verifying JAR Files for information on signing.有关签名的信息,请参阅签名和验证JAR文件。
Request the minimum level of permissions that is needed. 请求所需的最低权限级别。If the RIA does not require unrestricted access to a user's system, specify the permission level to be sandbox. 如果RIA不要求对用户系统进行无限制访问,请将权限级别指定为沙盒。See Security in Rich Internet Applications for more security guidelines.有关更多安全指南,请参阅富Internet应用程序中的安全。
Optimize the size of JAR files and related resources so that your RIA can load quickly. 优化JAR文件和相关资源的大小,以便您的RIA可以快速加载。See Reducing the Download Time for optimization techniques.有关优化技术,请参阅减少下载时间。
Enable the version download protocol and use background update checks to enable your RIA to start quickly. 启用版本下载协议并使用后台更新检查,以使您的RIA快速启动。See Avoiding Unnecessary Update Checks to learn more about the version download protocol and update checks.有关版本下载协议和更新检查的更多信息,请参阅避免不必要的更新检查。
Make sure that the client has the required version of the Java Runtime Environment software. 确保客户端具有所需版本的Java运行时环境软件。See Ensuring the Presence of the JRE Software for details on how the Deployment Toolkit script can be used for this purpose.有关如何将部署工具包脚本用于此目的的详细信息,请参阅确保JRE软件的存在。
Embed the contents of your applet's JNLP file in the <applet>
tag to avoid loading the JNLP file from the network. 将小程序JNLP文件的内容嵌入<applet>
标记中,以避免从网络加载JNLP文件。This feature was introduced in the Java SE 7 release. Java SE 7版本中引入了此功能。See Embedding JNLP File in Applet Tag to learn how to embed the contents of the applet's JNLP file in the web page.请参阅在Applet标记中嵌入JNLP文件,以了解如何在网页中嵌入Applet的JNLP文件的内容。
Preload your Java Web Start application, if possible. 如果可能,预加载Java Web Start应用程序。If you plan to deploy your RIA as a Java Web Start application in an enterprise where you have some administrative control, you can preload your application to various clients so that it is cached and ready to use. 如果您计划在具有一定管理控制的企业中将RIA部署为Java Web Start应用程序,则可以将应用程序预加载到各种客户端,以便缓存并准备使用。Use the following command to preload your Java Web Start application:使用以下命令预加载Java Web Start应用程序:
javaws -import -silent <jnlp url>