How to assert? [message #202957] |
Mon, 09 May 2005 10:35  |
Eclipse User |
|
|
|
Whenever I try to use assertions I always only get compile errors:
e.g.:
Severity Description Resource In Folder Location Creation Time
2 Syntax error on token "assert", assert expected <java file name,
package, etc. here>
???
Default JRE is a 1.4.2 SDK, Compiler compliance level is set to 1.4.
What else does one need to allow assertions in the source code? Why is
this not working?
This is on eclipse 3.0.1 on WinXP.
Michael
|
|
|
|
|
|
|
Re: assertions don't compile - what am I missing? [message #203388 is a reply to message #203327] |
Fri, 13 May 2005 04:28  |
Eclipse User |
|
|
|
Fixed - see my other append. Thanks nevertheless!
Michael
"Adam Kiezun" <akiezun@mit.edu> wrote in message
news:4283910F.60407@mit.edu...
>i held off replying because it seemed too trivial. I was waiting for
>your "Found it, never mind" message. :)
>
> just set the source and classfile compliance to 1.4 and you're done.
>
> /adam
>
> Michael Moser wrote:
>> Folks - is this such a complicated question that I don't get an
>> answer here?
>>
>> Isn't ANYBODY using assertions? If so, did that person have to enable
>> or configure anything special to get it working?
>> I can't believe that I should be the only one, where eclipse refuses
>> to accept assertions. After all that's a standard Java keyword...
>>
>> I am completely puzzled why my eclipse 3.0.1 refuses to compile event
>> the simplest assertion statements, like "assert false;" with an error
>> message as listed in my original append.
>>
>> Any help or hint would be appreciated!
>>
>> Michael
>>
>>
>>
>> "Michael Moser" <mmo@zurich.ibm.com> wrote in message
>> news:d5nsuj$73b$1@news.eclipse.org...
>>
>>> Whenever I try to use assertions I always only get compile errors:
>>> e.g.:
>>> Severity Description Resource In Folder Location Creation Time
>>> 2 Syntax error on token "assert", assert expected <java file name,
>>> package, etc. here>
>>>
>>> ???
>>>
>>> Default JRE is a 1.4.2 SDK, Compiler compliance level is set to 1.4.
>>>
>>> What else does one need to allow assertions in the source code? Why
>>> is this not working?
>>>
>>> This is on eclipse 3.0.1 on WinXP.
>>>
>>> Michael
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03945 seconds