您的位置:首页 > 编程语言 > Java开发

rcp(插件开发) 如何获取eclipse or rcp的安装目录

2012-09-12 18:16 399 查看
如题:

如下:

import java.net.URL;

import org.eclipse.core.runtime.Platform;

public class StudioInstallPathUtil {

public static String getStudioPath(){

String path = null;

//因为getInstallLocation已经单例模式,所以在此我们没必要单例了

org.eclipse.osgi.service.datalocation.Location location = Platform.getInstallLocation();

if (location != null) {

URL url = location.getURL();

path = url.getPath();

path=path.substring(1, path.length()-1);

}

return path;

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: