While trying to introduce enums in my Android project in Eclipse, I encountered with the following problem: Compiler says:
I work under Ubuntu 10.04 and use Eclipse v.3.5.2. Tried to use both Java 6 OpenJDK and Java 6 Sun, but without success.
Can anybody help me to sort out with this issue?
Here is the code:
public class MyClass {
public MyClass() {
}
...
enum MyEnum {
CONST1, CONST2, CONST3;
}
}
Open the properties for the project, select the page "Java Compiler" and set the "Compiler Compliance level" to "1.5" or better.
Hopefully the error will be resolved ...
Close project the project with the error.
Open a different project and launch in emulator. Close the alternative project.
Open the original project with the error which should no longer be evidenced.
Don't know why it works or if actually launching the app is necessary but it clears the error .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.