Get your CodeRanch badge!*
The moose likes IDEs, Version Control and other tools and the fly likes Assert stmt in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Assert stmt in Eclipse" Watch "Assert stmt in Eclipse" New topic
Author

Assert stmt in Eclipse

Lucky Singh
Ranch Hand

Joined: Jan 19, 2004
Posts: 125
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.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
You need to configure the complience level of the compiler in the Preferences.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Lucky Singh
Ranch Hand

Joined: Jan 19, 2004
Posts: 125
And how do I do that?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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

Joined: Jan 19, 2004
Posts: 125
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
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Assert stmt in Eclipse
 
Similar Threads
Assertion
Eclipse & assert
howto test "assert" in eclipse ?
assert in eclipse IDE
Being assertive with Eclipse