Get All directories containing java source code



I am developing a plugin that needs all the paths to directory containing any java source code. In Eclipse, it can be done using below code. I do not know how it can be done in IntelliJ IDEA. Please let me know if I can do the same in Intellij IDEA.

 Documentation for IClasspathEntry :

project = IJavaProject
IClasspathEntry[] entries = project.getResolvedClasspath(true);
List<IClasspathEntry> result = new ArrayList<IClasspathEntry>();
for (IClasspathEntry entry : entries) {
if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {


Please sign in to leave a comment.