We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果只有 jre, 可以 copy 一个 tools.jar 解决。
但是如果允许在第三方的云上面,比如 BAE, GAE,不允许使用 JDK 的 Compiler, 那么可以使用 JDT 来支持编译。
The text was updated successfully, but these errors were encountered:
JDT 支持 ServiceLoader 方式载入。
只需要把 org.eclipse.jdt.core_3.9.1.v20130905-0837.jar 放在 classpath 下面就可
javax.tools.JavaCompiler jcc = null; try { jcc = ToolProvider.getSystemJavaCompiler(); } catch(Throwable e) { jcc = null; } if (jcc == null) { ServiceLoader<javax.tools.JavaCompiler> serviceLoader = ServiceLoader.load(javax.tools.JavaCompiler.class); Iterator<javax.tools.JavaCompiler> iterator = serviceLoader.iterator(); if (iterator.hasNext()) { jcc = iterator.next(); } } if (jcc == null) { throw new IllegalStateException("Can't get system java compiler. Please add jdk tools.jar to your classpath."); }
Sorry, something went wrong.
暂时还是用 javax.tools.JavaCompiler 接口来使用 JDT.
696fa7f
subchen
No branches or pull requests
如果只有 jre, 可以 copy 一个 tools.jar 解决。
但是如果允许在第三方的云上面,比如 BAE, GAE,不允许使用 JDK 的 Compiler, 那么可以使用 JDT 来支持编译。
The text was updated successfully, but these errors were encountered: