*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes How to turn on assert in TextPad ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "How to turn on assert in TextPad ?" Watch "How to turn on assert in TextPad ?" New topic
Author

How to turn on assert in TextPad ?

Kay Liew
Ranch Hand

Joined: Dec 26, 2003
Posts: 112
How do i enable assert for the following class in TextPad ? Trying to use the -ea -da , but i do not think that is suitable for TextPad.




Thanks,


Unity can only be manifested by the Binary. Unity itself and the idea of Unity are already two.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Assertions are enabled with the "-ea" command when running the program from the Command Line. You do not enable assertions by modifying your source file (using TextPad).

For assertions to work, the file needs to be compiled with "-source 1.4" (without quotation marks) between the javac command and the file name.

By default, assertions are disabled when the program is run. To enable assertions, run the program with "-ea" (without quotation marks) between the java command and the file name.

Compiling with assertions:
javac - source 1.4 Filename.java

Running with assertions:
java -ea Filename


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Configure -> Preferences -> Tools -> Compile Java -> Parameters : -source 1.4 $File

Configure -> Preferences -> Tools -> Run Java -> Parameters : -ea $BaseName
[ October 06, 2004: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Kay Liew
Ranch Hand

Joined: Dec 26, 2003
Posts: 112
Barry, it works !!


Thank you both

k
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to turn on assert in TextPad ?