What version of Java is running in Eclipse?

前端 未结 8 916
爱一瞬间的悲伤
爱一瞬间的悲伤 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 12:51

    The one the eclipse run in is the default java installed in the system (unless set specifically in the eclipse.ini file, use the -vm option). You can of course add more Java runtimes and use them for your projects

    The string you've written is the right one, but it is specific to your environment. If you want to know the exact update then run the following code:

    public class JavaVersion {
      public static void main(String[] args) {
        System.out.println(System.getProperty("java.runtime.version"));
      }
    }
    

提交回复
热议问题