0
我目前正試圖通過使用日食工作區 和項目抽象來訪問我的eclipse項目,但我很快就失敗了。IllegalStateException:工作區關閉,同時調用ResourcesPlugin.getWorkspace()
請看看下面的代碼:
public static void main(String[] args) throws Exception {
String[] equinoxArgs = { "-debug", "-data", "C:\\dev\\build\\workspace" };
EclipseStarter.startup(equinoxArgs, null);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
System.out.println(workspace);
}
如果我執行它,我得到:
Exception in thread "main" java.lang.IllegalStateException: Workspace is closed.
at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(ResourcesPlugin.java:399)
at de.jaculon.samples.osgi.OsgiSample.main(OsgiSample.java:21)
有誰知道如何解決這一問題?
感謝您的幫助。