Eclipse Syntax Error On Token Enum Interface Expected
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings syntax error on token expected after this token in eclipse and policies of this site About Us Learn more about Stack Overflow syntax error on token void @ expected eclipse the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Syntax Error On Token Enum Delete This Token
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them;
Syntax Error On Token Throws Interface Expected
it only takes a minute: Sign up Eclipse chokes on enum, even though Compiler compliance level is 1.6 up vote 3 down vote favorite I have set my Eclipse project's Compiler compliance level to 1.6 But I get errors like in the screenshot below: Syntax error, annotations are only available if source level is 1.5. I have refreshed/cleaned/restarted Eclipse at syntax error on token enum identifier expected least 10 times. It compiles fine with Maven2. The Eclipse project has been generated by Maven2. The project uses java-6-openjdk java eclipse java-6 share|improve this question edited Dec 22 '11 at 2:20 asked Dec 22 '11 at 1:59 Nicolas Raoul 24.8k33119222 Which version of Eclipse? By "cleaning" do you mean blowing away the project file? What about metadata? are you sure the error description is the one for the enum? Something may be out-of-sync, because there aren't any annotations there. –Dave Newton Dec 22 '11 at 2:23 @DaveNewton: Eclipse Helios-SR2. By cleaning, I meant "Project>Clean". The error for the enum is Syntax error on token "enum", interface expected, in the screenshot I scrolled to show another error that I thought would be more interesting. The annotation is actually in another class. –Nicolas Raoul Dec 22 '11 at 2:35 add a comment| 2 Answers 2 active oldest votes up vote 7 down vote Other solution: 1) Set Workspace JRE to 1.5 (and apply/save). Projects will rebuild. 2) Set Workspace JRE back to 1.6 (and apply/save)
Things LocationTech Long-Term Support PolarSys Science OpenMDM More Community Marketplace Events Planet Eclipse Newsletter Videos Participate Report a Bug Forums Mailing Lists Wiki IRC How
Eclipse Syntax Error On Token Delete This Token
to Contribute Working Groups Automotive Internet of Things LocationTech Long-Term Support java enum example PolarSys Science OpenMDM Toggle navigation Home Projects Forums Eclipse Community Forums Forum Search: Search Help Register Login Home Home» Language IDEs» Java Development Tools (JDT)» JDT standalone not understanding ENUM Show: Today's Messages :: Show Polls :: Message Navigator JDT standalone http://stackoverflow.com/questions/8598661/eclipse-chokes-on-enum-even-though-compiler-compliance-level-is-1-6 not understanding ENUM [message #660775] Mon, 21 March 2011 14:42 Nicolas AnquetilMessages: 20Registered: May 2010 Junior Member Hi, I seem to have strong issues with JDT in standalone. Last week I posted a problem with Generics' binding for which isGeneric is always false. I still don't have a solution for this, any clue will be wellcome. I https://www.eclipse.org/forums/index.php/t/206410/ also have problems when parsing enums. Here is the source code I want to parse: enum Ego { I, Me, Myself }; class someClass { enum Julius { Veni, Vidi, Vici, Quasi }; } The external enum (Ego) is not accepted, instead it results in the following problems in the CompilationUnit Quote: [ Pb(204) Syntax error on token "enum", interface expected, Pb(232) Syntax error on token ",", delete this token, Pb(240) Syntax error, insert ";" to complete FieldDeclaration ] The enum inside the class (Julius) raises problems too, it ends up being treated as a FieldDeclaration. Quote: [ Pb(441) 'enum' should not be used as an identifier, since it is a reserved keyword from source level 1.5 on, Pb(2) enum cannot be resolved to a type, Pb(240) Syntax error, insert ";" to complete ClassBodyDeclarations, Pb(232) Syntax error on token ",", delete this token, Pb(240) Syntax error, insert ";" to complete BlockStatements ] The program I use to parse is (Is use JDT 3.6.0.v_A58) : public class Tester { public sta
This Site Careers Other all forums Forum: IDEs, Version Control and other tools Enum problem Phal https://coderanch.com/t/106322/vc/Enum Ach Ranch Hand Posts: 54 posted 8 years ago I https://www.daniweb.com/programming/software-development/threads/58742/jdk1-5-0-09-and-enums am using eclipse 3.0 but my jdk and jre are 1.5+. Somehow when I try to make enum, it gives me error like: Syntax error on token enum, interface expected. Can anybody please help me how to overcome syntax error this. Thanks marc weber Sheriff Posts: 11343 I like... posted 8 years ago Originally posted by Phalguni Bhatt: I am using eclipse 3.0 but my jdk and jre are 1.5+... Welcome to JavaRanch! Have you configured Eclipse to use 1.5? In Eclipse for Windows, I think these settings syntax error on are under Window > Preferences > Java > Compiler and Window > Preferences > Java > Installed JREs. (Come to think of it, I'm not sure whether Eclipse 3.0 will work with Java 1.5. You might need to upgrade Eclipse.) [ May 09, 2008: Message edited by: marc weber ] "We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org Post Reply Bookmark Topic Watch Topic New Topic Similar Threads Enum Constructor - Exception and Accessibility How use Enum in java 6.o SCJP 5: Mock questions How use Enum in Java 6.0 Let me put it this way...... All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter Contact Us | advertise | mobile view | Powered by JForum | Copyright © 1998-2016 Paul Wheaton
enums 2Contributors 3Replies 4Views 9 YearsDiscussion Span 9 Years Ago Last Post by jwenting 0 9 Years Ago 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: [IMG]http://i12.photobucket.com/albums/a248/CudmoreMB/RandForums/Screenshot.png[/IMG] 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 } **synchronized (theWorld) { System.out.println ("It's all mine..."); }** How many people have code in their Sigs? Cudmore 9 74 posts since Nov 2005 Community Member java Ask a Different Question 0 jwenting 1,594 9 Years Ago Check your compiler compliance settings. Most likely your project is configured for 1.4 language compliance. 0 Discussion Starter Cudmore 9 9 Years Ago 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 0 jwenting 1,594 9 Years Ago 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). Know someone who can help? Share a link on social media … This arti