943,740 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 9248
  • Java RSS
Oct 20th, 2006
0

jdk1.5.0_09 and enums

Expand Post »
I installed Ubuntu Linux this morning and got java jdk 1.5.0_09 installed, along with Eclipse, and then I imported a project I've been working on into the Eclipse workbench.
All configuration is fine, as far as I can say.

My problem: The program I am working on uses the Enum. I've basically built the entire program around the use of Enum, and it's a huge program -- I can't change change it to work with simple constants. My problem is that enum is not working for me. Maybe this is a bug in _09, since in _06 it works wonderfully. In any case, I'm wondering why I may be encountering this problem, and how do I fix it. Thanks.

Here is a screen-shot of my problem:
http://i12.photobucket.com/albums/a2...Screenshot.png
The error says: Syntax error on token "enum", interface expected
And the second one says: Syntax error on token ",", delete this token
And then everywhere in the program I make reference to the enum: {ClassName} cannot be resolved

The enum class follows the simple format:
Java Syntax (Toggle Plain Text)
  1. public enum ClassName {
  2. Var1,
  3. Var2,
  4. Var3,
  5. Etc
  6. }
Last edited by Cudmore; Oct 20th, 2006 at 9:50 pm.
Similar Threads
Reputation Points: 20
Solved Threads: 6
Junior Poster in Training
Cudmore is offline Offline
74 posts
since Nov 2005
Oct 23rd, 2006
0

Re: jdk1.5.0_09 and enums

Check your compiler compliance settings. Most likely your project is configured for 1.4 language compliance.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Oct 23rd, 2006
0

Re: jdk1.5.0_09 and enums

Click to Expand / Collapse  Quote originally posted by jwenting ...
Check your compiler compliance settings. Most likely your project is configured for 1.4 language compliance.
Ahh! Thank you very much!
I reliased today when I found the "This project is not JDK 1.5 compliant" error that my workspace wasn't configured for 1.5, so I checked workspace settings and, sure enough, the compiler compliance level was set to 1.4. You were exactly right! Thanks again.

-Matt
Reputation Points: 20
Solved Threads: 6
Junior Poster in Training
Cudmore is offline Offline
74 posts
since Nov 2005
Oct 23rd, 2006
0

Re: jdk1.5.0_09 and enums

No problem. Just remember that Eclipse doesn't even make use of the JDK you've installed (except to run itself). It has its own built-in compiler (which is decent but not quite identical in what it does to the official one from Sun).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Loops
Next Thread in Java Forum Timeline: Rubiks cubes little brother (lol)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC