javaeclipseversion

What version of Java is running in Eclipse?


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?


Solution

  • 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"));
      }
    }