Read eclipse installation path using eclipse API

I opened eclipse 3.3.2. Now I need to get the current installation path of eclispe. Is an

Is there any eclipse API to get the eclipse installation path? Please help in this regard.

Thanks at Advance ..

Snehal

+3
source share
2 answers

Since eclipse3.4 and the p2 mechanism , you can use org.eclipse.osgi.service.datalocation.Locationthat represents the url.

This interface includes ** ECLIPSE_HOME_FILTER**, a constant that defines the filter string for receiving a service that indicates the location of the home eclipse (i.e., " eclipse.home.location".)

eclipse3.3 "eclipse.home.location", :

System.getProperty("eclipse.home.location");
+6

, . () - . . ! , .

, , , :

Activator.getDefault().getBundle().getEntry(fileName);

Platform.getInstanceLocation().getURL().getPath();
+5

Source: https://habr.com/ru/post/1705233/


All Articles