Apache Commons JCI 1.1 发布

oschina
 oschina
发布于 2013年10月15日
收藏 25

JCI 是一个封装了 Java 编译器的类库。

示例代码:

JavaCompiler compiler = new JavaCompilerFactory().createCompiler("eclipse");
CompilationResult result = compiler.compile(sources, new FileResourceReader(sourceDir), new FileResourceStore(targetDir));

System.out.println( result.getErrors().length + " errors");
System.out.println( result.getWarnings().length + " warnings");

支持的编译器包括:

  • eclipse
  • janino
  • groovy
  • javac
  • rhino

Apache Commons JCI 1.1 发布了,改进记录:

Changes in this version:

o Updated the API to use generics
o JaninoJavaCompiler is now compatible with Janino 2.6 (JCI-69)
o EclipseJavaCompiler is now compatible with the Eclipse JDT compiler 4.2.2
o Dropped the javac compiler since it only worked with Java 5 (JCI-73)
o Improved the thread safety of FilesystemAlterationMonitor (JCI-74)
o The FilesystemAlterationMonitor thread is now a daemon thread (JCI-65)
o The Eclipse compiler now supports source/target 1.7

Fixed bugs:

o Fixed a NPE in FilesystemAlterationMonitor when the directory is not
readable (JCI-68)
o Compiling classes with cross imports using Janino no longer causes a
stack overflow (JCI-53)
o FilesystemAlterationMonitor no longer throws a NPE when calling stop()
before start() (JCI-62)
o EclipseJavaCompiler properly closes the InputStreams (JCI-58)
o Eclipse compiler settings are no longer ignored (JCI-50, JCI-51)
o Fixed an issue preventing the Eclipse compiler from loading resources
from the ResourceStore (JCI-56)
本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处,尊重他人劳动共创开源社区。
转载请注明:文章转载自 OSCHINA 社区 [http://www.oschina.net]
本文标题:Apache Commons JCI 1.1 发布
加载中

最新评论(3

awu
awu
不知道上面说的那么编译器有什么区别哦
爽歪歪ES
貌似可以用这货打造IDE
yuyuyuyu
yuyuyuyu
很强大的样子,有用过的没
返回顶部
顶部