Search code examples
javaeclipsepluginsclasspathworkspace

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. 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. 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. Have a nice day


Solution

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

    OR

    File -> Switch Workspace -> Other the shown directory is your current workspace.

    I hope this will help.