Meaningless Drivel is fun!*
The moose likes IDEs, Version Control and other tools and the fly likes the Eclipse compiler is playing a nasty trick on me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "the Eclipse compiler is playing a nasty trick on me" Watch "the Eclipse compiler is playing a nasty trick on me" New topic
Author

the Eclipse compiler is playing a nasty trick on me

John A Taylor
Greenhorn

Joined: Feb 07, 2006
Posts: 3
Never seen this before! Eclipse is supposed to compile each time you save: it stopped doing that for me at some point today. Now, I can type any junk at all into a source file and save, and the compiler completely ignores it. As an additional consequence, its quick-complete facility has gone out of synch: it no longer offers to autocomplete identifiers that were added since this problem started.
Compile errors are only reported when I run an Ant build (which I also do through Eclipse).
I've tried restarting Eclipse and even rebooting my machine. No dice. There does not seem to be any preferences setting for this behavior, and I can't find any discussion of if on the Web ... can anybody please tell me what's going on?!

Many thanks!
jat


John Taylor
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Hi John,

Welcome to JavaRanch!

Sounds like Eclipse has decided your project is not a Java project. I've never seen this happen, but maybe you're just talking about a new project you started? Make sure you create Java projects as Java projects.

I'm going to move this to our "IDEs and Other Tools" forum for any followup.


[Jess in Action][AskingGoodQuestions]
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
I have had similar behaviour when using Eclipse and Ant.
The approach I took to get Eclipse back in sync was:

Project --> Clean --> (check start a build immediately)
(Try doing a refresh of your project as well).
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

the Eclipse compiler is playing a nasty trick on me

Eclipse is not a compiler

There does not seem to be any preferences setting for this behavior


There is actually an option:
Window->Preferences->Workbench->Build Automatically

Make sure that it is on.


[My Blog]
All roads lead to JavaRanch
John A Taylor
Greenhorn

Joined: Feb 07, 2006
Posts: 3
I fixed it!

The cause, FYI:
Eclipse was complaining about three missing JAR files at the project level and saying it was unable to build the project. I had noticed these errors earlier but ignored them since (a) I was rather busy, (b) the JARs were already on the build path and I didn't understand what Eclipse was talking about, and (c) the Ant build was not affected so I was able to continue with my development / testing cycles.

It seems that Eclipse basically quit compiling at some point because of these outstanding problems. Once the build path errors were resolved (by removing the JARs and re-adding from other locations), the compiler and the quick-complete came back to life.

Thanks for all your suggestions, they all made good sense (and I had actually tried them yesterday). James, thanks for moving the subject to the right category. I should have seen that one before posting in the first place. "Java beginner" was kind of a shot in the dark.

regards,
jat

P.S. I do know that Eclipse is an IDE, not a compiler. A little imprecision by me in the wording.
John A Taylor
Greenhorn

Joined: Feb 07, 2006
Posts: 3

actually that's Ernest, thanks for moving the subject to the right category.
 
Consider Paul's rocket mass heater.
 
subject: the Eclipse compiler is playing a nasty trick on me