RSS Forums RSS

jdk1.5.0_09 and enums

Please support our Java advertiser: Programming Forums
Reply
Posts: 72
Reputation: Cudmore is an unknown quantity at this point 
Solved Threads: 5
Cudmore's Avatar
Cudmore Cudmore is offline Offline
Junior Poster in Training

Question jdk1.5.0_09 and enums

  #1  
Oct 20th, 2006
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:
public enum ClassName {
	Var1,
	Var2,
	Var3,
	Etc
}
Last edited by Cudmore : Oct 20th, 2006 at 8:50 pm.
synchronized (theWorld) { System.out.println ("It's all mine..."); }
How many people have code in their Sigs?
AddThis Social Bookmark Button
Reply With Quote  
Posts: 5,749
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Solved Threads: 205
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: jdk1.5.0_09 and enums

  #2  
Oct 23rd, 2006
Check your compiler compliance settings. Most likely your project is configured for 1.4 language compliance.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Posts: 72
Reputation: Cudmore is an unknown quantity at this point 
Solved Threads: 5
Cudmore's Avatar
Cudmore Cudmore is offline Offline
Junior Poster in Training

Solution Re: jdk1.5.0_09 and enums

  #3  
Oct 23rd, 2006
Originally Posted by jwenting View Post
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
synchronized (theWorld) { System.out.println ("It's all mine..."); }
How many people have code in their Sigs?
Reply With Quote  
Posts: 5,749
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Solved Threads: 205
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: jdk1.5.0_09 and enums

  #4  
Oct 23rd, 2006
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).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the Java Forum
Views: 5312 | Replies: 3 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 9:27 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC