Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Assert stmt in Eclipse  RSS feed

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use the assert stmt in eclipse.
assert dosomething();
The IDE does not seem to be recognizing this. How do I change my settings so that I can use this stmt?

Thanks.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to configure the complience level of the compiler in the Preferences.
 
Lucky Singh
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And how do I do that?
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which Eclipse version are you using? 3.1 has a nice filter field in the preference dialog which should make it very easy to find the settings. Do you know how to get to the preference dialog?
 
Lucky Singh
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse 3.1.
No, I don't know how to get to Preferences. When I first set up my project, I remember setting it to JDK 1.5 etc.
But I've forgotten how to do it. Can you please help me?
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the "window" menu, select "preferences...". In the upcoming dialog, select java, compiler in the tree. There you should find the compliance level setting somewhere.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!