Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

error: as of release 1.5, 'enum' is a keyword

Thread view: 
ros - 17 May 2007 06:56 GMT
Hello,

I am trying to run a simple web application using NetBeans from Marty
Hall's book Core Servlets and JSPs.

This webapp uses a package called Acme which I downloaded. Also in the
webapp I have a number of Applets. But when I try to build the project
it gives me the following error:

Compiling 157 source files to C:\NETBEANS Projects\Core Servlets Sample
\Chapter 14\ShadowedTextApplet\build\web\WEB-INF\classes
C:\NETBEANS Projects\Core Servlets Sample\Chapter 14\ShadowedTextApplet
\src\java\Acme\Psg.java:466: warning: as of release 1.5, 'enum' is a
keyword, and may not be used as an identifier
(try -source 1.5 to use 'enum' as a keyword)
Enumeration enum = path.elements();
C:\NETBEANS Projects\Core Servlets Sample\Chapter 14\ShadowedTextApplet
\src\java\Acme\Psg.java:467: warning: as of release 1.5, 'enum' is a
keyword, and may not be used as an identifier
(try -source 1.5 to use 'enum' as a keyword)
while ( enum.hasMoreElements() )

Can anybody advise me what I should modify to run this application?

Thanks in advance.
Ricky
Nigel Wade - 17 May 2007 10:27 GMT
> Hello,
>
[quoted text clipped - 22 lines]
> Thanks in advance.
> Ricky

That's just a warning, not an error. It's warning you that usage of enum as an
identifier means that you can't compile the code as version 1.5. To remove the
warning all you need to do is refactor your code to change the identifier
'enum' to a non-keyword.

Presumably you have already specified '-source 1.4', otherwise you would get the
error:
"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)"

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555

ros - 05 Jun 2007 05:49 GMT
> > Hello,
>
[quoted text clipped - 38 lines]
> E-mail :    n...@ion.le.ac.uk
> Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555

Hello Nigel,

Thank you very much for the explanation and really sorry for the late
reply.

Cheers
Ros


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.