How to use IWorkspace ws=ResourcesPlugin.getWorkspace()
of Eclipse in a normal Java project?
I want to use Eclipse workspace feting API (IWorkspace
), it works perfectly fine when I used this in Plug-in development.
But when I write a Java program and use the same code it stop working and throw exception: Exception in thread "main" java.lang.IllegalStateException: Workspace is closed.
public class GitStatusCall {
public static void main(String[] args) throws IOException, NoHeadException {
IWorkspace ws=ResourcesPlugin.getWorkspace();
System.out.println();
}
}