Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JavaCore.create() returns null
JavaCore.create() returns null [message #224949] Tue, 28 February 2006 14:03 Go to next message
Michael Pradel is currently offline Michael Pradel
Messages: 26
Registered: July 2009
Junior Member
Hi,

I've a builder, that reacts on resource changes. When adding a new
package, I'd like to get its corresponding IJavaElement.
JavaCore.create(resource)
works fine, when I create a package directly in the project root. When I
create it in any other directory (e.g. in "src"), create() returns
always null.

Any ideas why?? Thanks for any help,

Michael
Re: JavaCore.create() returns null [message #224957 is a reply to message #224949] Tue, 28 February 2006 15:27 Go to previous messageGo to next message
Eclipse User
Originally posted by: richkulp.us.NO_SPAM.ibm.com

It would return null if the IResource was an IFolder AND the location
you tried to place it (i.e. "src") is not a package fragment root. In
other words, was "src" marked as a source folder?

Since it allowed you to create it in the root, that indicates to me that
the root of the project was the source folder, and "src" was not a
source folder!

Michael Pradel wrote:
> Hi,
>
> I've a builder, that reacts on resource changes. When adding a new
> package, I'd like to get its corresponding IJavaElement.
> JavaCore.create(resource)
> works fine, when I create a package directly in the project root. When I
> create it in any other directory (e.g. in "src"), create() returns
> always null.
>
> Any ideas why?? Thanks for any help,
>
> Michael

--
Thanks,
Rich Kulp
Re: JavaCore.create() returns null [message #225041 is a reply to message #224957] Wed, 01 March 2006 18:42 Go to previous message
Michael Pradel is currently offline Michael Pradel
Messages: 26
Registered: July 2009
Junior Member
> Since it allowed you to create it in the root, that indicates to me that
> the root of the project was the source folder, and "src" was not a
> source folder!

Thanks! That was the reason.

Michael
Previous Topic:administrating eclipse: how to bundle custom code formatting/code templates?
Next Topic:Compile folder is unexpected
Goto Forum:
  


Current Time: Thu Oct 23 19:15:46 GMT 2014

Powered by FUDForum. Page generated in 0.03746 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software