[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] Re: problems with validateClasspath
|
More stacktrace information would be helpful. My guess is that that your
project does not exist or does not have a Java nature. Then
javaProject.getRawClassPath throws an exception.
Martin
"Stephen Willoughby" <stephen.willoughby@xxxxxxxxxx> wrote in message
news:b6c6f1$lbe$1@xxxxxxxxxxxxxxxx
> I'm trying to programatically add entries to the Java Build Path for java
> projects in my plugin. However I want to make sure that it's all still
> 'legal' after my additions. (Ideally I'd like to check what I'm adding is
ok
> before I add it, but I've not had any luck there). The problem I'm
getting
> is that when I run the code below I get:
>
> "Unhandled exception caught in event loop.
> Reason:
> org/eclipse/jdt/core/JavaModelException"
>
> try
> {
> JavaProject javaProject = (JavaProject)project;
>
> IJavaModelStatus status = JavaConventions.validateClasspath(
> javaProject,javaProject.getRawClasspath(),
> javaProject.getOutputLocation() );
> System.out.println( status.getMessage() );
> }
> catch (JavaModelException e)
> {
> e.printStackTrace();
> }
> catch (Throwable e)
> {
> e.printStackTrace();
> }
>
>
> it's definately this code causing the exception becuase if I comment it
out
> then I no longer get the error. Any ideas?
>
>
> --
> Steve Willoughby
> stephen.willoughby@xxxxxxxxxx
>
>