简体   繁体   English

如何自动查找当前的Eclipse工作空间类路径?

[英]how to find the current workspace classpath of eclipse automatically?

my question is about classpaths. 我的问题是关于类路径的。 For my plugin project in eclipse, to realize some process I need to search some files under eclipse of workspace. 对于我在eclipse中的插件项目,要实现一些过程,我需要在工作区eclipse下搜索一些文件。 To do this, my project need a dynamic workspace classpath. 为此,我的项目需要一个动态工作空间类路径。 This thing should find the classpath of workspace automatically and return a String and I need that string very much. 这个东西应该自动找到工作空间的类路径并返回一个String,我非常需要该字符串。 by the way I am a very new about java and plugin but I need do that for my summer practise project, it is almost finished. 顺便说一句,我是一个关于Java和插件的新手,但是我的暑期实践项目需要这样做,它几乎完成了。 Have a nice day 祝你今天愉快

ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();

OR 要么

File -> Switch Workspace -> Other the shown directory is your current workspace. File -> Switch Workspace -> Other显示的目录是您当前的工作区。

I hope this will help. 我希望这将有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM