This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 1753

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.
It is sorta covered in the JavaRanch Style Guide.
subject: JAVA Assertions
Similar Threads
Could not create the java vitrual machine?
JDK 1.1.6 on P4 PC is not working
executing java program whose class file is in diff path
Java, Netbeans work fine but no javac