Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Java in General and the fly likes JAVA Assertions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "JAVA Assertions" Watch "JAVA Assertions" New topic

JAVA Assertions

Nancy Antony
Ranch Hand

Joined: Sep 06, 2007
Posts: 145

I installed JDK6. And when I write a simple program with assertion it neither works in command prompt nor in Netbeans6.9. I think if it will work in command prompt it will work in JDK. I tried java -ea both in command prompt as well as in Netbeans VM options. Any idea why its not working.

Jelle Klap

Joined: Mar 10, 2008
Posts: 1951

Maybe the assert condition simply isn't violated?
Some relevant code and the exact command-line invocation might help shed some light on things.

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
I agree. Here's the link:
subject: JAVA Assertions
jQuery in Action, 3rd edition