• 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

Eclipse and assertion??

 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi:
How can I enable assertion at runtime using Eclipse?
I am using JDK 1.4. When it compiles, it can recognize "assert" as a keyword, but during runtime, it doesn't throw any assertion error, it completly bybass the assert statement.
any help is greatly appreciated.
 
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Click on the Run->Run... menu item to bring up the "Create, manage, and run configurations" dialog. Select your run configuration. Select the Arguments tab. Enter

in the MLE entitled "VM arguments:".
-Jeff-
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Jeff:
Thank you so much, you solved my problem.
I have another problem with Eclipse. My program compile and run fine qith asserting enabled, but I got this error when I try to generate java documentaion.
<pre>
C:\dev\bitsutilities\src\java\us\sc\state\dhhs\database\BaseServiceImpl.java:289: warning: as of release 1.4, assert is a keyword, and may not be used as an identifier
assert (pStatement != null) : "The given PreparedStatement is null";
</pre>
I don't use "assert" as an identifier. I have the following line inside a private method.
assert(pStatement != null) : "The given ....";
the previous line generate an error if I try to generate java documentation
if I change it to:
assert(pStatement != null);
It works fine.
It recognize one style of asserting but not the other.
do you what is going on.
thanks
 
Jeff Langr
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When running either javac or javadoc, specify the parameter:

For example:

-Jeff-
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeff:
Do you know where can I set this parameters in Eclipse?
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never mind Jeff. I found it.
thank you for your help
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic