Problems with "enum" in Xcode 2.4

Hello,

Using a MacBook, Xcode 2.4, trying to compile this code in class "Card.java":

publicclass Card{

publicenum Rank{ DEUCE, THREE, FOUR, FIVE, SIX,

SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE}// Line 10

publicenum Suit{ CLUBS, DIAMONDS, HEARTS, SPADES}// Line 13

privatefinal Rank rank;

privatefinal Suit suit;

private Card(Rank rank, Suit suit){

this.rank = rank;

this.suit = suit;

}

}// class ends

However, when I use Xcode's "Build" command, I get the following errors and warnings:

Card.java:10: warning: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier

Card.java:10: ';' expected

Card.java:13: warning: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier

Card.java:13: ';' expected

If I run "javac" on this file, it works just fine - and the code is from an example somewhere on sun.java.com. Do anyone understand why this does not work? Have I misunderstood the "enum" syntax, or is this Xcode-related?

Appreciate any help on this - I would like to use Xcode (or like to know if I can't).

[1860 byte] By [paulantona] at [2007-11-27 7:03:31]
# 1

http://lists.apple.com/archives/Java-dev/2005/Dec/msg00279.html

Apple is behind the times here regarding Java 5. Tiger shipped with 1.4.2, and doesn't generally like Java 5 for development under XCode (much less the Java 6 developer preview), so you have to point the compiler variable to the Java 5 version of javac in your target's build settings.

I tried to use XCode for Java development on the Mac in the past, and found it to be a terrible pain, so I now use Eclipse. Your mileage may vary, and I wish you luck.

kevjavaa at 2007-7-12 18:54:45 > top of Java-index,Java Essentials,Java Programming...