Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Assert with Java 1.4
Assert with Java 1.4 [message #45418] Fri, 30 May 2003 16:40 Go to next message
Eclipse UserFriend
Originally posted by: newsgroup.salas.com

I can't seem to get the new assert statement to work. It compiles fine, but

assert false;

does not do anything. (neither does assert true;)

I did set up the project properties to be 1.4 compliant and to treat
identifiers named assert as errors.

What am I missing?

Thanks

Pito
Re: Assert with Java 1.4 [message #45508 is a reply to message #45418] Fri, 30 May 2003 16:57 Go to previous messageGo to next message
Eclipse UserFriend
Pito Salas wrote:
> I can't seem to get the new assert statement to work. It compiles fine, but
>
> assert false;
>
> does not do anything. (neither does assert true;)
>
> I did set up the project properties to be 1.4 compliant and to treat
> identifiers named assert as errors.
>
> What am I missing?

You need to enable assertions in the JVM. They are not enabled by
default for some reason. Add "-ea" to the VM arguments in your launch
configuration.

Jeff
Re: Assert with Java 1.4 [message #45865 is a reply to message #45508] Sat, 31 May 2003 14:01 Go to previous message
Eclipse UserFriend
Originally posted by: newsgroup.salas.com

Thanks. It worked.

"Jeff Hunter" <jxh106@po.cwru.edu> wrote in message
news:bb8gka$f3a$1@rogue.oti.com...
> Pito Salas wrote:
> > I can't seem to get the new assert statement to work. It compiles fine,
but
> >
> > assert false;
> >
> > does not do anything. (neither does assert true;)
> >
> > I did set up the project properties to be 1.4 compliant and to treat
> > identifiers named assert as errors.
> >
> > What am I missing?
>
> You need to enable assertions in the JVM. They are not enabled by
> default for some reason. Add "-ea" to the VM arguments in your launch
> configuration.
>
> Jeff
>
Previous Topic:plugin development demo for a new view with treeview dont work
Next Topic:which eclipse.?.? for product ideas/discussions
Goto Forum:
  


Current Time: Tue Jul 22 01:58:20 EDT 2025

Powered by FUDForum. Page generated in 0.09954 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top