• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Eclipse Still Compiles Even With Errors

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way to turn off whatever is allowing Eclipse to generate a .class file even when there are errors? I don't like the fact that there can still be errors in my source code but a .class is generated. If I try to use this class...it's broken anyway so why generate it?

Thanks,
Jim
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jim,
Is it generating a new class file or is it the one from the last compile?

I think the class file gets generated anyway for incremental compilation to work.
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well it wont generate the ones with errors, but it will do the ones it can. you can turn down the error tolerance. there are a certain number of errors it will try to compile through before it stops.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mr. C Lamont Gilbert:
well it wont generate the ones with errors, but it will do the ones it can.



Actually it will even compile those with errors. When the compile time error is hit at runtime, some kind of Error is thrown (something like UnresolvedCompileError).

It's actually a feature: you can still run a debug your code as long as you don't run across the compile problem. You can even fix the compile error while debugging your program and hope that the hot code swap works.

I agree that it feels strange at first. I'd advice to get over it...
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It does indeed generate a brand new .class file for the broken source. When I try to run this broken class file I'll get an exception:

"Exception in thread "main" java.lang.Error: Unresolved compilation problem:"

So how do I turn off this "feature"?
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I wanted to turn it off, I'd probably search in the somewhere in the Java preferences, probably under compiler.

I still don't understand why you want to, though...
 
reply
    Bookmark Topic Watch Topic
  • New Topic