What version of Java is running in Eclipse?

2019-03-10 16:09发布

How do I know what version of Java is being run in Eclipse?

Is there a way to write code to find out?

Is "JRE System Library [JavaSE-1.6]" in "Package Explorer" the right version?

8条回答
ら.Afraid
2楼-- · 2019-03-10 16:43
String runtimeVersion = System.getProperty("java.runtime.version");

should return you a string along the lines of:

1.5.0_01-b08

That's the version of Java that Eclipse is using to run your code which is not necessarily the same version that's being used to run Eclipse itself.

查看更多
仙女界的扛把子
3楼-- · 2019-03-10 16:45

Under the help menu, there should be a menu item labeled "About Eclipse" I can't say with absolute precision because I'm using STS which is the same thing but my label is different.

In the dialog box that opens after you click the relevant about menu item there should be an installation details button in the lower left hand corner.

The version of Java that you're running Eclipse against ought to be in "System properties:" under the "Configuration" tab.

查看更多
登录 后发表回答