0
我有一個Eclipse插件,並已經知道我可以檢索工作區相關束路徑是這樣的:Platform.getBundle返回null
Bundle bundle = FrameworkUtil.getBundle(getClass());
IPath path = Platform.getStateLocation(bundle);
如果我把這些代碼到的啓動方法我捆綁激活類一切正常。但是我需要插件中另一個類的路徑。現在
,我試圖做得到 '捆綁' 這樣的:
bundleID = "de.some.thing.plugin" // ID of that plugin like in plugin.xml
Bundle bundle = Platform.getBundle(bundleID);
...
但這返回null。任何人都可以幫助我排除故障或理解爲什麼它不起作用嗎?
我沒想到FrameworkUtil.getBundle(getClass())可以在我的插件的任何類中工作。但你是對的。這有幫助!非常感謝! – July