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发行说明。
This section covers some common problems that you might encounter when developing and deploying Java Web Start applications. 本节介绍在开发和部署Java Web Start应用程序时可能遇到的一些常见问题。After each problem is a list of possible reasons and solutions.在每个问题之后都列出了可能的原因和解决方案。
Problem: My browser shows the Java Network Launch Protocol (JNLP) file for my application as plain text.我的浏览器将我的应用程序的Java网络启动协议(JNLP)文件显示为纯文本。
Most likely, your web server is not aware of the proper MIME type for JNLP files. 很可能,您的web服务器不知道JNLP文件的正确MIME类型。See the Setting up the web server section for more information.
Furthermore, if you are using a proxy server, ensure that the update versions of the files are returned, by updating the time stamp of the resources on the web server such that the proxies will update their caches.此外,如果您使用的是代理服务器,请确保返回文件的更新版本,方法是更新web服务器上资源的时间戳,以便代理更新其缓存。
Problem: When I try to launch my JNLP file, I get the following error:当我尝试启动JNLP文件时,出现以下错误:
MissingFieldException[ The following required field is missing from the launch file: (<application-desc>|<applet-desc>|<installer-desc>|<component-desc>)] at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source) at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source) at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source) at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source) at com.sun.javaws.Main.launchApp(Unknown Source) at com.sun.javaws.Main.continueInSecureThread(Unknown Source) at com.sun.javaws.Main.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
Often this error occurs when your XML is malformed. 当XML格式不正确时,通常会发生此错误。You can stare at the code until you figure it out but it is easier to run an XML syntax checker over the file. 您可以一直盯着代码看,直到弄明白为止,但在文件上运行XML语法检查器更容易。(NetBeans IDE and jEdit both provide XML syntax checkers.)(NetBeans IDE和jEdit都提供XML语法检查器。)
However, this error can occur in a other situations and the above was caused by the following line in an otherwise well-formed XML file:但是,在其他情况下可能会发生此错误,上述错误是由格式良好的XML文件中的以下行引起的:
<description kind="short">Demonstrates choosing the drop location in the target <code>TransferHandler</code></description>
The error was caused by the illegal embedded 错误是由非法嵌入的code
tags.code
标记引起的。