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发行说明。
Self-contained applications include everything that an application needs to run. If your application requires an external library, that library can be added to the bundle for the application. Adding the library can be done in different ways.
The File Association Demo described in Using File Associations downloads the Groovy library as part of the build process. The library is placed in the /lib
directory in the project for the application. This directory is then copied to the /dist
directory from which the self-contained application bundle is generated.
The following code in the -pre-init
task in the build.xml
file shows how the library is downloaded:
<!-- download and copy groovy library --> <copy toFile="lib/groovy-all-2.3.8.jar"> <resources> <url url="http://central.maven.org/maven2/org/codehaus/groovy/groovy-all/2.3.8/groovy-all-2.3.8.jar"/> </resources> </copy>
See build.xml
for the complete build code.
You can download the source files for the File Association Demo from Self-Contained Application Examples.