实践jdk6新特性

Scripting Language Support (Rhino)

Rhino是一个基于java实现的JavaScript引擎

1
2
3
4
5
6
7
8
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("js");
// 执行js
Object result = engine.eval("'Hello, World!'.length");
System.out.println(result);
// 执行外部js
result = engine.eval(Files.newBufferedReader(Paths.get("hello.js")));
System.out.println(result);

Java8新引入了一个JavaScript引擎Nashorn

JDBC 4.0 API

Java Compiler API

Pluggable Annotations

Native PKI, Java GSS, Kerberos and LDAP support.

Integrated Web Services.

Lot more enhancements.

参考

Java Versions, Features and History

Java Programming Language Enhancements