简体   繁体   English

如何找出Windows使用的是哪个Eclipse安装的JDK(不是JRE)

[英]How to find out which JDK (not JRE) an installation of Eclipse on Windows is using

How can I find out where the JDK which Eclipse is using to compile resides? 我如何找出Eclipse用于编译的JDK所在的位置? It's possible to find the location(s) of JREs in Window, Preferences, Java. 可以在Window,Preferences,Java中找到JRE的位置。 Even the compiler level (1.7) is there. 甚至还有编译器级别(1.7)。

I can also find out which version of Java is installed using "where java", but "where javac" does not yield a result. 我还可以使用“ where java”来找出安装了哪个Java版本,但是“ where javac”不会产生结果。

Since .java files can be compiled, some Java compiler (so a JDK) must be present. 由于.java文件可以编译,因此必须存在一些Java编译器(因此是JDK)。 It's very tedious to search all directories and hasn't shown a usable result yet. 搜索所有目录非常繁琐,但尚未显示可用的结果。

Somewhere in Eclipse's settings the path to the JDK must be saved. 在Eclipse设置中的某处,必须保存JDK的路径。 As far as I know, JAVA_HOME environment variable isn't used. 据我所知,未使用JAVA_HOME环境变量。

So how can I find out where the used JDK is? 那么,如何找出使用过的JDK在哪里呢? I actually need to find the programs xjc and schemagen, but the search of the total disk couldn't find it. 我实际上需要找到程序xjc和schemagen,但是在总磁盘搜索中找不到它。 I find this contradictory. 我发现这是矛盾的。

Help menu -> About -> Installation details button -> Configuration tab 帮助菜单->关于->安装详细信息按钮->配置选项卡

Here you can find all system properties and Eclipse arguments including: 在这里,您可以找到所有系统属性和Eclipse参数,包括:

-vm
C:/Program Files (x86)/Java/jdk1.7.0_55/bin/javaw.exe

This is the Java VM on which Eclipse runs. 这是运行Eclipse的Java VM。

Eclipse has its internal compiler. Eclipse有其内部编译器。 It does not use javac to compile Java sources, Eclipse doesn't even require JDK just a JRE (and is still able to compile Java sources). 它不使用javac来编译Java源代码,Eclipse甚至不需要JDK只是一个JRE(并且仍然能够编译Java源代码)。

窗口->首选项-> Java->已安装的JRE- >如果还有更多的JRE ,则选择正确的JRE并检查JDK或JRE安装目录的位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM