查找 Eclipse 版本号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2604869/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:19:12  来源:igfitidea点击:

Finding the Eclipse Version Number

eclipseversion

提问by Casebash

I have posted how to find it in Eclipse Gallileo, but if anyone has information on older versions feel free to post it below.

我已经发布了如何在 Eclipse Gallileo 中找到它,但如果有人有关于旧版本的信息,请随时在下面发布。

采纳答案by VonC

(Update September 2012):

(2012 年 9 月更新):

MRTpoints out in the commentsthat "Eclipse Version" question references a .eclipseproductin the main folder, and it contains:

MRT指出在评论中说:“ Eclipse版本”的问题引用一个.eclipseproduct主文件夹,它包含:

name=Eclipse Platform
id=org.eclipse.platform
version=3.x.0

So that seems more straightforward than my original answer below.

所以这似乎比我下面的原始答案更直接。

Also, Neeme Praksmentions belowthat there is a eclipse/configuration/config.iniwhich includes a line like:

此外,Neeme Praks下面提到有一个eclipse/configuration/config.ini包含如下行的内容:

eclipse.buildId=4.4.1.M20140925-0400

Again easier to find, as those are Java properties set and found with System.getProperty("eclipse.buildId").

再次更容易找到,因为这些是使用System.getProperty("eclipse.buildId").



Original answer (April 2009)

原始答案(2009 年 4 月)

For Eclipse Helios 3.6, you can deduce the Eclipse Platform version directly from the About screen:
It is a combination of the Eclipse global version and the build Id:

对于 Eclipse Helios 3.6,您可以直接从“关于”屏幕推断 Eclipse 平台版本:
它是 Eclipse 全局版本和构建 ID 的组合:

alt text

替代文字

Here is an example for Eclipse 3.6M6:
The version would be: 3.6.0.v201003121448, after the version 3.6.0 and the build Id I20100312-1448 (an Integration build from March 12th, 2010 at 14h48

以下是 Eclipse 3.6M6 的示例:
版本将是:3.6.0.v201003121448,在版本 3.6.0 和构建 ID I20100312-1448 之后(2010 年 3 月 12 日 14:48 的集成构建)

To see it more easily, click on "Plugin Details" and sort by Version.

要更轻松地查看它,请单击“插件详细信息”并按版本排序。



Note: Eclipse3.6 has a brand new cool logo:

注意:Eclipse3.6有一个全新的酷标志:

alt text

替代文字

And you can see the build Id now being displayed during the loading step of the different plugin.

您可以看到在不同插件的加载步骤中现在显示的构建 ID。

回答by Casebash

In Eclipse Gallileo:

在 Eclipse Gallileo 中:

The about page (Help -> About Eclipse) has some icons towards the bottom of the dialogue. This should include two which are the plain Eclipse icon. Select the one with tooltip "Eclipse.org". Eclipse has many components, each of which has its own version number. The core is the Eclipse Platform

关于页面(帮助 -> 关于 Eclipse)在对话框底部有一些图标。这应该包括两个纯 Eclipse 图标。选择带有工具提示“Eclipse.org”的那个。Eclipse 有许多组件,每个组件都有自己的版本号。核心是Eclipse平台

回答by rai.skumar

I think, the easiest way is to read readmefile inside your Eclipse directory at path eclipse/readme/eclipse_readme.

我认为,最简单的方法是读取Eclipse 目录中的自述文件 path eclipse/readme/eclipse_readme

At the very top of this file it clearly tells the version number:

在这个文件的最顶部,它清楚地告诉了版本号:

For My Eclipse Juno; it says version as Release 4.2.0

为我的日食朱诺;它说版本为Release 4.2.0

回答by Neeme Praks

Here is a working code snippet that will print out the full version of currently running Eclipse (or any RCP-based application).

这是一个工作代码片段,它将打印出当前运行的 Eclipse(或任何基于 RCP 的应用程序)的完整版本。

String product = System.getProperty("eclipse.product");
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint("org.eclipse.core.runtime.products");
Logger log = LoggerFactory.getLogger(getClass());
if (point != null) {
  IExtension[] extensions = point.getExtensions();
  for (IExtension ext : extensions) {
    if (product.equals(ext.getUniqueIdentifier())) {
      IContributor contributor = ext.getContributor();
      if (contributor != null) {
        Bundle bundle = Platform.getBundle(contributor.getName());
        if (bundle != null) {
          System.out.println("bundle version: " + bundle.getVersion());
        }
      }
    }
  }
}

It looks up the currently running "product" extension and takes the version of contributing plugin.

它查找当前运行的“产品”扩展并获取贡献插件的版本。

On Eclipse Luna 4.4.0, it gives the result of 4.4.0.20140612-0500which is correct.

在 Eclipse Luna 4.4.0 上,它给出了4.4.0.20140612-0500正确的结果。

回答by sudhan

if you want to access this programatically, you can do it by figuring out the version of eclipse\plugins\org.eclipse.platform_ plugin

如果你想以编程方式访问它,你可以通过找出 eclipse\plugins\org.eclipse.platform_ plugin 的版本来实现

    String platformFile = <the above file>; //actually directory

versionPattern = Pattern.compile("\d\.\d\.\d");
Matcher m = versionPattern.matcher(platformFile);
return m.group();

回答by Neeme Praks

There is a system property eclipse.buildId(for example, for Eclipse Luna, I have 4.4.1.M20140925-0400as a value there).

有一个系统属性eclipse.buildId(例如,对于 Eclipse Luna,我的值是4.4.1.M20140925-0400)。

I'm not sure in which version of Eclipse did this property become available.

我不确定这个属性在哪个版本的 Eclipse 中可用。

Also, dive right in and explore all the available system properties -- there is quite a bit of information available under eclipse.*, os.* osgi.* and org.osgi.* namespaces.

此外,深入探索所有可用的系统属性——在 eclipse.*、os.* osgi.* 和 org.osgi.* 命名空间下有相当多的可用信息。



UPDATE!After experimenting with different Eclipse versions, it seems that eclipse.buildIdsystem property is not the way to go. For example, on Eclipse Luna 4.4.0, it gives the result of 4.4.2.M20150204-1700which is obviously incorrect.

更新!在尝试了不同的 Eclipse 版本后,似乎eclipse.buildId系统属性不是要走的路。例如,在 Eclipse Luna 4.4.0 上,它给出的结果4.4.2.M20150204-1700显然是不正确的。

I suspect eclipse.buildIdsystem property is set to the version of org.eclipse.platformplugin. Unfortunately, this does not (always) give the correct result. However, good news is that I have a solution with working code sample which I will outline in a separate answer.

我怀疑eclipse.buildId系统属性设置为org.eclipse.platform插件的版本。不幸的是,这并不(总是)给出正确的结果。但是,好消息是我有一个包含工作代码示例的解决方案,我将在单独的答案中概述。

回答by Mario Galea

For Eclipse Java EE IDE - Indigo: Help > About Eclipse > Eclipse.org (third from last). In the 'About Eclipse Platform' locate Eclipse Platform and you'll have the version beneath the Version Column. Hope this helps J2EE Indigo Users.

对于 Eclipse Java EE IDE - Indigo:帮助 > 关于 Eclipse > Eclipse.org(倒数第三个)。在“关于 Eclipse 平台”中找到 Eclipse 平台,您将在版本列下方看到版本。希望这有助于 J2EE Indigo 用户。

回答by Michael Osofsky

For Eclipse Kepler, there is no Help > About Eclipse but I found this works:

对于 Eclipse Kepler,没有 Help > About Eclipse,但我发现这有效:

Eclipse > About Eclipse

Eclipse > 关于 Eclipse