Reputation: 6009
I installed the new eclipse Luna.
How I can know in code if the eclipse version ?(Luna or Kepler ....) I want to do it in code.I need to add logic in case that the eclipse is Luna
Upvotes: 0
Views: 1669
Reputation: 111217
In an Eclipse plugin you can get information about the product using:
IProduct product = Platform.getProduct();
The about dialog text is obtained with:
String aboutText = product.getProperty(IProductConstants.ABOUT_TEXT);
I don't think there is anything that just gives you the Eclipse version (4.4) or name (Luna).
Often it is better to check the version of a particular plugin, for example:
Bundle bundle = Platform.getBundle("org.eclipse.platform");
Version version = bundle.getVersion();
if (version.getMajor() == 4 && version.getMinor() == 4)
{
... version 4.4
}
Upvotes: 1
Reputation: 7079
In the menu bar GO to Help > About Eclipse.
Ex. -
Version: Indigo Service Release 1
Build id: 20110916-0149
Upvotes: 0