What version of Java is running in Eclipse?

前端 未结 8 845
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 12:33

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 Exp

相关标签:
8条回答
  • 2020-12-24 13:07

    Don't about the code but you can figure it out like this way :

    Go into the 'window' tab then preferences->java->Installed JREs. You can add your own JRE(1.7 or 1.5 etc) also.

    For changing the compliance level window->preferences->java->compiler. C Change the compliance level.

    0 讨论(0)
  • 2020-12-24 13:07
    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.

    0 讨论(0)
提交回复
热议问题