java ENUM error when using jdk 1.5

Hi,
I got some sample code and when I try to compile it I get the following errors. Any ideas how I can fix them

thanks
-anshu

----------------------------------------------------------------------------------------------------------

WritebackUtils.java:162: as of release 1.5, 'enum' is a keyword, and may not be
used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
    public static int getIntEnumVal(String enum) {
                                           ^
WritebackUtils.java:163: as of release 1.5, 'enum' is a keyword, and may not be
used as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier)
        return Integer.parseInt(HTTPHelper.getEnumerationValue(enum));                                                              ^




anshumaEngineeringAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VenabiliCommented:
Rename your variable from enum to something else
enum is an identifier for the new enum type from 1.5 up so you cannot use it as a regular name for a variable

public static int getIntEnumVal(String enum) {
should be
public static int getIntEnumVal(String enum1) { //for example
and then change all references in the method itself
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
basav_comCommented:
What said by Venabili is correct.
Following is the extra information. If it is OK to compile with javac 1.4 then you can try the following option to overcome the above error without changing the enum variables references in the code.
javac -source 1.4 <javafile.java>
0
anshumaEngineeringAuthor Commented:
You guys are awesome. Thanks a ton
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.