I am working in a java plugin for Eclipse and i need get the project path from plugin Example
/home/user/workspace/project_name/
And i dont know how.
I tried this but it did not work
if (window != null)
{
IStructuredSelection selection = (IStructuredSelection) window.getSelectionService().getSelection();
Object firstElement = selection.getFirstElement();
if (firstElement instanceof IAdaptable)
{
IProject project = (IProject)((IAdaptable)firstElement).getAdapter(IProject.class);
IPath path = project.getFullPath();
// System.out.println(path);
Runtime.getRuntime().exec("zenity --warning --text '"+path+"';echo $?");
}
}