Get rid of Enum warnings in Eclipse 3.1

M

MartinKess

Hi

My current project is in Java 1.4.2, and I was wondering if there was
any way to turn off the warning that ''enum' should not be used as an
identifier, since it is a reserved keyword from source level 5.0 on''

Thanks in advance.
 
I

IchBin

Hi

My current project is in Java 1.4.2, and I was wondering if there was
any way to turn off the warning that ''enum' should not be used as an
identifier, since it is a reserved keyword from source level 5.0 on''

Thanks in advance.
You can try below path but think you have to be running 5.0 in Eclipse.

Windows \ Preferences \ Java \ Compiler \ Error/Warnings
\ J2SE 5.0 Options
--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
I

IchBin

IchBin said:
You can try below path but think you have to be running 5.0 in Eclipse.

Windows \ Preferences \ Java \ Compiler \ Error/Warnings
\ J2SE 5.0 Options

Sorry, It can be turned of for 1.4

Windows \ Preferences \ Java \ Compiler \ JDK Compliance \ Use
Compliance settings \ Disallow identifiers call 'enum'

--

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
H

Hendrik Maryns

(e-mail address removed) schreef:
Hi

My current project is in Java 1.4.2, and I was wondering if there was
any way to turn off the warning that ''enum' should not be used as an
identifier, since it is a reserved keyword from source level 5.0 on''

Then set the project properties to 1.4 compliance:
Project -> Properties -> Java Compiler -> Enable project specific
settings -> Compiler compliance level

H.

--
Hendrik Maryns

==================
www.lieverleven.be
http://aouw.org
 
R

Roedy Green

My current project is in Java 1.4.2, and I was wondering if there was
any way to turn off the warning that ''enum' should not be used as an
identifier, since it is a reserved keyword from source level 5.0 on''

It should not, just as goto should not even though it is not
implemented.

Ironically, the tools to turn off warnings come in JDK 1.5, where
using enum that way is an error not a warning.

What you are doing is a bigger sin than you imagine.

1. JDK 1.4 is already 14 months old. At some point it will be
discontinued. You are fobbing the job of fixing your error off on
someone in the future who will know less than you about your program.

2. in the meantime anyone writing JDK 1.5+ code won't be able to
reference you code even if your code is compiled in 1.4.
 
M

mrandywarner

Actually in preferences if you go to Java->Compiler in the "JDK
compliance" section there is a setting called "Disallow identifiers
called 'enum'" that lets you set the level to Ignore, Warning, or Error
 
Joined
Oct 7, 2008
Messages
1
Reaction score
0
IchBin thanks for the response. Very useful.

Roedy I work on a project that has hundreds of these warnings in code developed by another team. I couldn't even fix these if I wanted to. So what's wrong with me disabling the warnings? Otherwise, the Problems View is basically useless.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top