什么版本的Java在Eclipse中运行? [英] What version of Java is running in Eclipse?

查看:108
本文介绍了什么版本的Java在Eclipse中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有没有办法编写代码来找出?



Package Explorer中的JRE系统库[JavaSE-1.6]是否正确版本?

解决方案

eclipse运行的是系统中安装的默认java(除非在eclipse.ini文件中专门设置,请使用-vm选项)。您可以添加更多的Java运行时并将其用于您的项目



您编写的字符串是正确的字符串,但它特定于您的环境。如果您想知道确切的更新,请运行以下代码:

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


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?

解决方案

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

这篇关于什么版本的Java在Eclipse中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆