ToolProvider.getSystemJavaCompiler()始终使用jdk返回null [英] ToolProvider.getSystemJavaCompiler() always returning null using jdk
问题描述
我阅读了有关此问题的所有帖子,没有解决方案适用于我,我总是 null
。
我使用JRE和将tools.jar放在lib目录中,将其添加到构建路径但是当我想跳转到声明时,Eclipse想要跳进 rt.jar (?),我完全不明白。
这可能是我只得到 null
的原因吗?如何正确配置?
getSystemJavaCompiler()
返回null的条件是什么?
I read all the posts regarding this problem and no solution works for me, I get always null
.
I use JRE and put the tools.jar in the lib directory, added it to the build path but when I want to jump to declaration Eclipse wants to jump into rt.jar (?) what I totally don't understand.
Could that be the reason that I get only null
? How can I configure that correctly?
What are the criteria for getSystemJavaCompiler()
to return null?
推荐答案
JRE是Java 运行时环境。它没有编译器,因此你得到一个 null
。如果使用完整的JDK,则会得到非null结果。
JRE is the Java Runtime Environment. It doesn't have a compiler, and therefore you're getting a null
. If you use a full-fledged JDK, you'd get a non-null result.
这篇关于ToolProvider.getSystemJavaCompiler()始终使用jdk返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!