社区首页 >问答首页 >如何获得Eclipse安装目录的绝对路径?问如何获得Eclipse安装目录的绝对路径?ENStack Overflow用户提问于 2010-12-21 06:18:09回答 2查看 17.5K关注 0票数 12我正在编写一个由插件组成的Eclipse产品。
在我的一个插件中,我需要获取Eclipse安装目录的绝对路径。
(即Mac上的/Applications/Eclipse或Win上的C:\Program Files\Eclipse )。
找不到用于此操作的API。想法?
eclipse-plugindirectoryinstallation关注问题分享EN回答 2推荐最新Stack Overflow用户回答已采纳发布于 2010-12-21 06:25:53
codejammer建议:
下面给出了安装位置
代码语言:javascript复制Platform.getInstallLocation().getURL()请参阅org.eclipse.core.runtime.Platform API
代码语言:javascript复制/**
* Returns the location of the base installation for the running platform
* null is returned if the platform is running without a configuration location.
*
* This method is equivalent to acquiring the org.eclipse.osgi.service.datalocation.Location
* service with the property "type" equal to {@link Location#INSTALL_FILTER}.
*
* @return the location of the platform's installation area or null if none
* @since 3.0
* @see Location#INSTALL_FILTER
*/收藏分享票数 12ENStack Overflow用户发布于 2014-07-16 15:54:32
它应该是
代码语言:javascript复制Platform.getInstallLocation().getURL()收藏分享票数 4EN页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持原文链接:https://stackoverflow.com/questions/4494528
复制相关文章