Skip to main content



      Home
Home » Newcomers » Newcomers » X cannot be resolved to a type (although it's there)
X cannot be resolved to a type (although it's there) [message #182130] Wed, 29 November 2006 07:10 Go to next message
Eclipse UserFriend
Originally posted by: schwall.uni-muenster.de

Hi all!

I'm developing a database-based application using hibernate and ant both
on Linux and Mac OS X.

Now I've got some really annoying problem that comes up at two different
occasions:

- If the ant build fails, I've got several broken dependencies that can
only be resolved by opening a bunch of my java files, making a change
(doesn't matter which), saving it, undoing the change, saving it again.

- Now (this occurred just this morning) on the Linux machine there's
nearly the same thing only the build does not need to fail any more. I
change something I want/have to change and save it. Some broken
dependencies are shown by eclipse, I open one of the files (it's fewer
than in the first case), change it, save it, undo the change and save it
again and can compile.

Where does this come from? What am I doing wrong?

Johannes
Re: X cannot be resolved to a type (although it's there) [message #182159 is a reply to message #182130] Wed, 29 November 2006 12:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

Johannes Schwall wrote:
> Hi all!
>
> I'm developing a database-based application using hibernate and ant both
> on Linux and Mac OS X.
>
> Now I've got some really annoying problem that comes up at two different
> occasions:
>
> - If the ant build fails, I've got several broken dependencies that can
> only be resolved by opening a bunch of my java files, making a change
> (doesn't matter which), saving it, undoing the change, saving it again.
>
> - Now (this occurred just this morning) on the Linux machine there's
> nearly the same thing only the build does not need to fail any more. I
> change something I want/have to change and save it. Some broken
> dependencies are shown by eclipse, I open one of the files (it's fewer
> than in the first case), change it, save it, undo the change and save it
> again and can compile.
>
> Where does this come from? What am I doing wrong?

How are you launching your Ant build? If it is via Eclipse, you should
make sure that the options in the Ant launch are set to automatically
refresh the appropriate Eclipse project(s).
If you are launching Ant manually (not via Eclipse), you will have to
manually refresh the appropriate Eclipse project or build output directory.
The above applies if your Eclipse project and your Ant build share a
common ouput location - Eclipse needs to be told that some other tool
(Ant) has modified files, which is what the refresh steps above will do.

Hope this helps,
Eric
Re: X cannot be resolved to a type (although it's there) [message #182354 is a reply to message #182159] Thu, 30 November 2006 07:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: schwall.uni-muenster.de

Eric Rizzo wrote:

> How are you launching your Ant build? If it is via Eclipse, you should
> make sure that the options in the Ant launch are set to automatically
> refresh the appropriate Eclipse project(s).
> If you are launching Ant manually (not via Eclipse), you will have to
> manually refresh the appropriate Eclipse project or build output directory.
> The above applies if your Eclipse project and your Ant build share a
> common ouput location - Eclipse needs to be told that some other tool
> (Ant) has modified files, which is what the refresh steps above will do.

Hi Eric,

Thanks for your help. I'm launching the ant build through right-clicking
on my buildfile and selecting "Run as". Until now I didn't use the
"refresh" function found there, because I didn't really know what it
meant. I'll give it a try now, though I'm not sure if it changes anything
as I am not working "outside" of Eclipse.

And this will probably not change anything concerning the second part of
my problem, will it? As this error occurs without any changes outside
Eclipse and even without building, there cannot really be a connection
there ...

Johannes
Re: X cannot be resolved to a type (although it's there) [message #182584 is a reply to message #182354] Fri, 01 December 2006 13:41 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

Johannes Schwall wrote:
> Eric Rizzo wrote:
>
>> How are you launching your Ant build? If it is via Eclipse, you should
>> make sure that the options in the Ant launch are set to automatically
>> refresh the appropriate Eclipse project(s).
>> If you are launching Ant manually (not via Eclipse), you will have to
>> manually refresh the appropriate Eclipse project or build output
>> directory.
>> The above applies if your Eclipse project and your Ant build share a
>> common ouput location - Eclipse needs to be told that some other tool
>> (Ant) has modified files, which is what the refresh steps above will do.
>
> Hi Eric,
>
> Thanks for your help. I'm launching the ant build through right-clicking
> on my buildfile and selecting "Run as". Until now I didn't use the
> "refresh" function found there, because I didn't really know what it
> meant. I'll give it a try now, though I'm not sure if it changes
> anything as I am not working "outside" of Eclipse.
>
> And this will probably not change anything concerning the second part of
> my problem, will it? As this error occurs without any changes outside
> Eclipse and even without building, there cannot really be a connection
> there ...

Any kind of modification (by Ant or any other tool) of files that are
part of our Eclipse project(s) can cause things to get a little
confused. Eclipse will generally alert you to this condition whenever
you try to operate on the file(s) that was/were changed, like open or
search, etc. So if you run an Ant build that touches the files that
Eclipse is using, you'll need to use the "auto refresh" option of the
Ant launch.
Both of these problems sound very flaky, and I am just sort-of guessing
that it might be related to a refresh problem. For your second problem,
you can try refreshing the entire project to see if it goes away.

Hope this helps,
Eric
Previous Topic:Switch to default perspective
Next Topic:How do I make an Executable file in java
Goto Forum:
  


Current Time: Thu May 29 00:25:13 EDT 2025

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

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

Back to the top