Pave the project build path through the eclipse plugin

I need to programmatically check if the project build path already contains the specified library. This is a quick fix suggestion to know if it has already been β€œfixed” and may not be a problem.

I have access to the current IInvocationContext and therefore (around some corners) to the corresponding IProject .

How can I check which libraries are referencing my build path already?

+4
source share
1 answer
  • Use JavaCore (in jdt.core) to create an IJavaProject from IProject (use the create () method). This IJavaProject project is an IProject with the ability to answer Java environment questions about the project.
  • IJavaProject has several options for the findType () method, which you can use to query the classpath for a project

I will leave it, but let me know if you need more information.

+5
source

Source: https://habr.com/ru/post/1435364/


All Articles