如何在eclipse插件中获取项目的输出类路径 [英] How to get the output classes path of the project in the eclipse plugin

查看:129
本文介绍了如何在eclipse插件中获取项目的输出类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取输出文件夹的绝对路径。它可能是工作区外的文件夹的链接。

I want to get the absolute path of the output folder. It may be a link to a folder outside the workspace.

推荐答案

如果要获取系统路径的输出以编程方式(对于eclipse插件),您可以使用 IJavaProject

If you want to get the system path of the output of a project programmatically (for an eclipse plugin), you could use IJavaProject:

IPath path = project.getOutputLocation();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IFolder folder = root.getFolder(path);
return folder.getLocation();

另外详细说明

ResourcesPlugin.getWorkspace().getRoot().findMember(javaProject.getOutputLocation()).getLocation();

这篇关于如何在eclipse插件中获取项目的输出类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆