Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Syntax error on token "assert" even though compliance is 1.4
Syntax error on token "assert" even though compliance is 1.4 [message #150468] Wed, 24 March 2004 14:02 Go to next message
Eclipse UserFriend
Originally posted by: murphy.genome.chop.edu

I'm using Eclipse 3.0M7 on Mac OS X 10.2.8 (JVM 1.4.1).

Even though Properties/Java Compiler/Compliance and Classfiles/Compiler
Compliance Level is
set to 1.4, assert statements are causing this error:

Syntax error on token "assert", assert expected

I tried various permutations on the Compliance tab to no effect.

TIA
Re: Syntax error on token "assert" even though compliance is 1.4 [message #150494 is a reply to message #150468] Wed, 24 March 2004 15:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: olivier_thomannNOSPAM.ca.ibm.com

Kevin Murphy a écrit :
> I'm using Eclipse 3.0M7 on Mac OS X 10.2.8 (JVM 1.4.1).
>
> Even though Properties/Java Compiler/Compliance and Classfiles/Compiler
> Compliance Level is
> set to 1.4, assert statements are causing this error:
>
> Syntax error on token "assert", assert expected
>
> I tried various permutations on the Compliance tab to no effect.
To compile assert statements, you need:
- compliance set to 1.4
- source level set to 1.4
- target platform set to 1.4
- assert as an identifier set to error.

Compliance 1.4 means the compiler is behaving like javac 1.4. By default
javac 1.4 is not compiling assert statements. You need to set explicitly
the source level to 1.4 using -source 1.4. This is the same kind of
settings in Eclipse.
--
Olivier
Re: Syntax error on token "assert" even though compliance is 1.4 [message #150502 is a reply to message #150494] Wed, 24 March 2004 17:19 Go to previous message
Eclipse UserFriend
Originally posted by: murphy.genome.chop.edu

Merci beaucoup. J'ai réussi. Changing the disallow dropdown box from
warning to error was
what I needed to know. Left on 'Warning', the dialog box would act as if
the combination of
source and target of 1.4 was invalid.

Olivier Thomann wrote:
> To compile assert statements, you need:
> - compliance set to 1.4
> - source level set to 1.4
> - target platform set to 1.4
> - assert as an identifier set to error.
> Compliance 1.4 means the compiler is behaving like javac 1.4. By default
> javac 1.4 is not compiling assert statements. You need to set explicitly
> the source level to 1.4 using -source 1.4. This is the same kind of
> settings in Eclipse.
Previous Topic:Default Output Dir missing from Package Explorer
Next Topic:eclipse printing plugin
Goto Forum:
  


Current Time: Wed Jun 18 15:50:54 EDT 2025

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

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

Back to the top