JAVA 7 正式版发布 新特性一览表

openkk 13年前
     <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;" lang="EN-US">Swing</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 新增<span lang="EN-US"> JLayer </span>类,是一个灵活而且功能强大的<span lang="EN-US">Swing</span>组件修饰器,使用方法:<span lang="EN-US">How to Decorate Components with JLayer.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">Nimbus Look and Feel </span>外观从<span lang="EN-US"> com.sun.java.swing </span>包移到<span lang="EN-US"> javax.swing </span>包中,详情:<span lang="EN-US">javax.swing.plaf.nimbus.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 更轻松的重量级和轻量级组件的混合。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 支持透明窗体以及非矩形窗体的图形界面,请看<span lang="EN-US"> How to Create Translucent and Shaped Windows</span>。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">JColorChooser </span>类新增<span lang="EN-US"> HSV tab.<br /> <br /> </span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;">网络</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 新增<span lang="EN-US"> URLClassLoader.close </span>方法,请看<span lang="EN-US"> Closing a URLClassLoader.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 支持<span lang="EN-US"> Sockets Direct Protocol (SDP) </span>提供高性能网络连接,详情请看<span lang="EN-US"> Understanding the Sockets Direct Protocol.<br /> <br /> </span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;">集合</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 新增<span lang="EN-US"> TransferQueue </span>接口,是<span lang="EN-US"> BlockingQueue </span>的改进版,实现类为<span lang="EN-US"> LinkedTransferQueue.<br /> </span></span></span><span style="font-family:宋体;"><b><span style="font-size:10.5pt;"><br /> <span lang="EN-US">RIA/</span>发布</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 拖拽的小程序使用一个默认或者定制的标题进行修饰,详情:<span lang="EN-US">Requesting and Customizing Applet Decoration in Draggable Applets.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">JNLP </span>文件做了如下方面的增强,详情请看<span lang="EN-US"> JNLP File Syntax:</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">The os attribute in the information and resources elements can now contain specific versions of Windows, such as Windows Vista or Windows 7.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">Applications can use the install attribute in the shortcut element to specify their their desire to be installed. Installed applications are not removed when the Java Web Start cache is cleared, but can be explicitly removed using the Java Control Panel.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">Java Web Start applications can be deployed without specifying the codebaseattribute; see Deploying Without Codebase</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 可直接在<span lang="EN-US"> HTML </span>中嵌入<span lang="EN-US"> JNLP </span>文件:<span lang="EN-US">Embedding JNLP File in Applet Tag.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 可在<span lang="EN-US"> JavaScript </span>代码中检查<span lang="EN-US"> Applet </span>是否已经加载完成:<span lang="EN-US">Handling Initialization Status With Event Handlers.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 可在<span lang="EN-US"> Applet </span>从快捷方式启动或者拖出浏览器时对窗口样式和标题进行控制:<span lang="EN-US">Requesting and Customizing Applet Decoration in Developing Draggable Applets.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;"> <br /> <span lang="EN-US">XML</span></span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 包含<span lang="EN-US"> Java API for XML Processing (JAXP) 1.4.5, </span>支持<span lang="EN-US"> Java Architecture for XML Binding(JAXB) 2.2.3, </span>和<span lang="EN-US"> Java API for XML Web Services (JAX-WS) 2.2.4.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;" lang="EN-US"><br /> java.lang </span></b><b><span style="font-size:10.5pt;">包</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 消除了在多线程环境下的非层次话类加载时导致的潜在死锁,详情:<span lang="EN-US">Multithreaded Custom Class Loaders in Java SE 7.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;"> <span lang="EN-US"><br /> Java </span>虚拟机</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 支持非<span lang="EN-US"> Java </span>语言<span lang="EN-US">: Java SE 7 </span>引入一个新的<span lang="EN-US"> JVM </span>指令用于简化实现动态类型编程语言。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">Garbage-First Collector </span><span style="color:#000000;">是一个</span><span lang="EN-US"><span lang="EN-US"><span lang="EN-US"><span style="color:#000000;">服务器</span></span></span></span><span style="color:#000000;">端的垃圾收集器用于替换</span><span lang="EN-US"><span style="color:#000000;"> </span>Concurrent Mark-Sweep Collector (CMS).</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 提升了<span lang="EN-US"> Java HotSpot </span>虚拟机的性能。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;"> <span lang="EN-US">Java I/O</span></span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">java.nio.file </span>包以及相关的包<span lang="EN-US"> java.nio.file.attribute </span>提供对文件<span lang="EN-US"> I/O </span>以及访问文件系统的全面支持,请看<span lang="EN-US"> File I/O (featuring NIO.2).</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 目录 <span lang="EN-US">/sample/nio/chatserver/ </span>包含使用<span lang="EN-US"> java.nio.file </span>包的演示程序。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 目录 <span lang="EN-US">/demo/nio/zipfs/ </span>包含<span lang="EN-US"> NIO.2 NFS </span>文件系统的演示程序。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;"> <br /> 安全性</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 新的内置对多个基于<span lang="EN-US"> ECC </span>算法<span lang="EN-US">(ECDSA/ECDH)</span>的支持,详情请看:<span lang="EN-US">Sun PKCS#11 Provider's Supported Algorithms in Java PKCS#11 Reference Guide.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 禁用了一些弱加密算法,详情请看<span lang="EN-US"> Appendix D: Disabling Cryptographic Algorithms in Java PKI Programmer's Guide and Disabled Cryptographic Algorithms in Java Secure Socket Extension (JSSE) Reference Guide.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">Java </span>安全套接字扩展中对<span lang="EN-US"> SSL/TLS </span>的增强。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;"> <br /> 并发</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">fork/join </span>框架,基于<span lang="EN-US"> ForkJoinPool </span>类,是<span lang="EN-US"> Executor </span>接口的实现,设计它用来进行高效的运行大量任务<span lang="EN-US">;</span>使用<span lang="EN-US"> work-stealing </span>技术用来保证大量的<span lang="EN-US"> worker </span>线程工作,特别适合多处理器环境,详情请看<span lang="EN-US"> Fork/Join</span>。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 目录<span lang="EN-US">/sample/forkjoin/ </span>包含了<span lang="EN-US"> fork/join </span>框架的演示程序。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">ThreadLocalRandom </span>类<span lang="EN-US">class </span>消除了使用伪随机码线程的竞争,请看<span lang="EN-US"> Concurrent Random Numbers.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">Phaser </span>类是一个新的同步的屏障,与<span lang="EN-US"> CyclicBarrier </span>类似。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;"> <br /> <span lang="EN-US">Java 2D</span></span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 一个新的基于<span lang="EN-US"> XRender </span>的<span lang="EN-US"> Java 2D </span>渲染管道支持现在的<span lang="EN-US"> X11 </span>桌面,改善了图形性能,请看<span lang="EN-US"> System Properties for Java 2D Technology </span>中的<span lang="EN-US"> xrender .</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">JDK </span>可枚举并显示出已安装的<span lang="EN-US"> OpenType/CFF </span>字体,通过<span lang="EN-US">GraphicsEnvironment.getAvailableFontFamilyNames </span>方法<span lang="EN-US"> See Selecting a Font.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">TextLayout </span>类支持西藏语脚本。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">libfontconfig, </span>是一个字体配置<span lang="EN-US"> api </span>,<span lang="EN-US">see Fontconfig.</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;"> <br /> 国际化</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 支持<span lang="EN-US"> Unicode 6.0.0</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> 目录 <span lang="EN-US">/demo/jfc/Font2DTest/ </span>包含<span lang="EN-US"> Unicode 6.0 </span>的演示程序。</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <span lang="EN-US">Java SE 7 </span>可容纳在<span lang="EN-US"> ISO 4217 </span>中新的货币,详情请看<span lang="EN-US"> Currency </span>类。<br /> <br /> </span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-family:宋体;"><b><span style="font-size:10.5pt;" lang="EN-US">Java </span></b><b><span style="font-size:10.5pt;">编程语言特性</span></b></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <b>·</b> 二进制数字表达方式</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <strong><span style="font-family:宋体;mso-bidi-font-family:宋体;">·</span></strong> 使用下划线对数字进行分隔表达,例如<span lang="EN-US"> 1_322_222</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <strong><span style="font-family:宋体;mso-bidi-font-family:宋体;">·</span></strong><span lang="EN-US"> switch </span>语句支持字符串变量</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <strong><span style="font-family:宋体;mso-bidi-font-family:宋体;">·</span></strong> 泛型实例创建的类型推断</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <strong><span style="font-family:宋体;mso-bidi-font-family:宋体;">·</span></strong> 使用可变参数时,提升编译器的警告和错误信息</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <strong><span style="font-family:宋体;mso-bidi-font-family:宋体;">·</span></strong><span lang="EN-US"> try-with-resources </span>语句</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <strong><span style="font-family:宋体;mso-bidi-font-family:宋体;">·</span></strong> 同时捕获多个异常处理</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <strong><span style="font-family:宋体;mso-bidi-font-family:宋体;">·</span></strong><span lang="EN-US"> JDBC 4.1</span></span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <strong><span style="font-family:宋体;mso-bidi-font-family:宋体;">·</span></strong> 支持使用<span lang="EN-US"> try-with-resources </span>语句进行自动的资源释放,包括连接、语句和结果集</span></span></p>    <p style="line-height:12pt;margin:0cm 0cm 0pt;"><span style="font-size:10.5pt;"><span style="font-family:宋体;"> <strong><span style="font-family:宋体;mso-bidi-font-family:宋体;">·</span></strong> 支持<span lang="EN-US"> RowSet 1.1</span></span></span></p>