[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Programatically change java build path

"Jeff Brown" <brown_j@xxxxxxxxxx> wrote in message 
news:e1jd73$f3g$1@xxxxxxxxxxxxxxxxxxxx
> Olivier Thomann wrote:
>> Ryan Hollom a écrit :
>>
>>> Are there (non-internal) APIs available to programatically change the 
>>> java build path on a java project?  In particular, I am looking to 
>>> remove some source entries on the build path, as well as add an 
>>> exclusion directory on an existing source directory.

As Olivier says, look at IJavaProject.  In particular, setRawClasspath() and 
getRawClasspath().

There are unfortunately no APIs to directly modify the classpath: you have 
to get it, edit it, and then set the new one.  Be cautious of the potential 
for threading problems, if more than one thread at a time is doing that.