Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Compiler Prefs: 'assert' cannot be an identifier
Compiler Prefs: 'assert' cannot be an identifier [message #146498] Mon, 20 October 2003 10:13 Go to next message
Eclipse UserFriend
Originally posted by: ah.wyona.com

Hi Eclipse team,

I just upgraded to 3.0-M4 and want to set 1.4 code compatibility
in the compiler preferences tab. But when I set "Source compatibility"
to "1.4", the dialog complains:

"When source compatibility is 1.4, 'assert' cannot be an identifier."

and won't let me click "OK".

Setting "Report 'assert' as identifier" to "ignore" doesn't help.
What am I doing wrong?

Thanks in advance!

-- Andreas
Re: Compiler Prefs: 'assert' cannot be an identifier [message #146582 is a reply to message #146498] Mon, 20 October 2003 14:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ah.wyona.com

Andreas Hartmann wrote:

> Hi Eclipse team,
>
> I just upgraded to 3.0-M4 and want to set 1.4 code compatibility
> in the compiler preferences tab. But when I set "Source compatibility"
> to "1.4", the dialog complains:
>
> "When source compatibility is 1.4, 'assert' cannot be an identifier."
>
> and won't let me click "OK".
>
> Setting "Report 'assert' as identifier" to "ignore" doesn't help.

OK, I had to set it to "error". IMHO this is quite strange ...
Why isn't this option activated + disabled automatically?

-- Andreas
Re: Compiler Prefs: 'assert' cannot be an identifier [message #146602 is a reply to message #146582] Mon, 20 October 2003 14:53 Go to previous message
Eclipse UserFriend
Originally posted by: olivier_thomann.ca.ibm.comNOSPAM

Le Mon, 20 Oct 2003 16:32:27 +0200, Andreas Hartmann <ah@wyona.com> a
écrit :
>OK, I had to set it to "error". IMHO this is quite strange ...
>Why isn't this option activated + disabled automatically?
You have two different settings.
1) Compiler compliance level:
When this is set to 1.4, Eclipse compiler "behaves" as javac 1.4. This
doesn't mean that assertion is enabled. By default javac 1.4 doesn't
enable the assertion support. You need to set the source level.
2) Source compatibility. This is equivalent to the -source option of
javac. So if you se -source 1.4 it doesn't make sense to report assert
as an identifier, because you enabled the assertion support and this
means that now "assert" is a keyword.

I would enter a bug against JDT/UI to set the three options once you
select the source compatibility to 1.4. The target (generated .class
file compatibility) should also be 1.4, because once the assertion are
enabled, the required JVM is 1.4 or above.

Hope this clarify a bit the compiler options.

Olivier
Previous Topic:Infocenter error: HTTP Status 500
Next Topic:Running Eclipse twice gives a Source loactor doesn't exist : org.eclipse.jdt.debug.ui.javasourceloca
Goto Forum:
  


Current Time: Sun Sep 01 05:13:44 GMT 2024

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

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

Back to the top