• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic