Java 我如何找出 Eclipse 使用的 JDK 版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2573836/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do i find out the JDK version Eclipse is using?
提问by JavaRocky
I see JRE all over the place, but i can not be sure which JDK is compiling my code. How do i find out?
我到处都看到 JRE,但我不能确定哪个 JDK 正在编译我的代码。我怎么知道?
采纳答案by Alex Jasmin
Actually Eclipse has its own compiler. You can develop java apps using only the JRE and Eclipse
实际上 Eclipse 有自己的编译器。您可以仅使用 JRE 和 Eclipse 开发 Java 应用程序
回答by Michael Patterson
You can still check/set which JDK version you want to compile to. If you go to Window->Preferences, then click "Java" from the menu on the left and then "Compiler". The first setting allows you to see which JDK version is being complied with.
您仍然可以检查/设置要编译为哪个 JDK 版本。如果您转到“窗口”->“首选项”,则从左侧菜单中单击“Java”,然后单击“编译器”。第一个设置允许您查看正在遵守的 JDK 版本。
I know this doesn't directly answer your question since JDK isn't actually compiling it, but hopefully it helps!
我知道这并不能直接回答您的问题,因为 JDK 实际上并未编译它,但希望它有所帮助!
回答by Summer
You don't find JDK explicitly mentioned anywhere because way to point to a JDK is under the name of 'Installed JRE'. That is Window > Preferences > Java > Installed JREs. This is useful when using m2e plugin.
您没有在任何地方找到明确提到的 JDK,因为指向 JDK 的方式是在“已安装的 JRE”的名称下。即 Window > Preferences > Java > Installed JREs。这在使用 m2e 插件时很有用。
secondly apart from having it's own built in compiler, it is recommended to you install one of your own to support development of Java programs. Except below from eclipse wiki page:
其次,除了自带编译器外,建议安装一个自己的编译器来支持Java程序的开发。除了下面的 eclipse wiki页面:
If you intend to use Eclipse for Java development, then you should install a JDK
如果您打算使用 Eclipse 进行 Java 开发,那么您应该安装一个 JDK