Saturday, 8 November 2014

How to get Workspace location in Eclipse RCP Plug-in ?

Try following :


//get object which represents the workspace
IWorkspace workspace = ResourcesPlugin.getWorkspace();

//get location of workspace (java.io.File)
File workspaceDirectory = workspace.getRoot().getLocation().toFile()


Add Following Package to dependency in Manifiest.MF
org.eclipse.core.resources