I found the solution:
IStructuredSelection ss = (IStructuredSelection) selection;
IResource resource = (IResource) ss.getFirstElement();
project= resource.getProject();
IJavaProject javaProject= JavaCore.create(project);
classpath= javaProject.getRawClasspath();
for (IClasspathEntry entry : classpath) {
if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
libs [i] = entry.getPath();
}
how to get a list of referenced libraries of a project in eclipse plugin development?
-
13-07-2023 - |
Вопрос
I am a able to get a reference to a project in eclipse. Like this
public void selectionChanged(IAction action, ISelection selection) {
IStructuredSelection ss = (IStructuredSelection) selection;
IResource resource = (IResource) ss.getFirstElement();
project= resource.getProject();
}
But i need to get the list of referenced libraries in that project. Google is not helping . Kindly help.
Thanks.
Решение
Не связан с StackOverflow