I’m to be having a bit of a problem implementing enums in Java 6 on eclipse the actual code I’ve been trying to implement is actually from Java 5 (and I know it is correct because it compiled and ran in version 5) however java 6 rejects it. I’ve even tried putting in really simple enum declarations from example books and they also bomb. Any ideas?
I haven’t had any problems with enums in Java 6.
Please post some code so that we can try it out.
If you can post the error(s) you see and the code you are using, that would help. My suspicion, though, is that your compiler compliance level isn’t set correctly.
Right-click on the project and choose Build Path -> Configure Build Path. On the window that appears, click on the Java Compiler entry and then look at your Compiler Compliance Level. Is it 6.0? If not, try setting it to 6.0 and see if that helps.
Yup that did the trick, it was being compiled at 1.42 level which is funny because I’d specified version 6 in other places and when I created the project. Thanks you saved me loads of headaches in the future.