Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [jdt-dev] problem by using JavaCore.create(..)

Hello,

> i've some problems by using the JavaCore.create(..). i've 
> written a plug-in,
> and i implemented the IActionDelegate interface from the package
> org.eclipse.ui. in this implementation i extract a IResource
> (org.eclipse.core.resource.IResource) from the 
> IStructuredSelection-"Object". now i want to get the
> IJavaProject - which i can use in another framework. first i 
> ask IProjcet projcet
> = IResource.getProject() - no problems. but as soon as i ask 
> IJavaProject

why don't you extract an IJavaElement from the IStructuredSelection and 
retrieve the IJavaProject from it.

> myJavaProject = JavaCore.create(project) i'll get a runtime error. the
> error-message is:
> "Unhadled event loop exception
>  Reason:
>  org/eclipse/jdt/core/JavaCore"
> 
> and i have no more ideas how i can  prevent this exception!

Maybe you forgot to include a reference to the jdt.core plugin in your 
plugin.xml file?

<requires>
	<import plugin="org.eclipse.jdt.core"/>
</requires>

Christian


Back to the top