• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to turn on assert in TextPad ?

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Kay Liew
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Barry, it works !!


Thank you both

k
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic