jdk1.5.0_01 + eclipse3.0.1 problem using enum?

the environment I'm using is jdk1.50._01 + eclipse3.0.1.

When I try to type the class in eclipse, the keyword "enum" high-light and show error messages below:

- Syntax error, insert ";" to complete FieldDeclaration

- enum cannot be resolved( or is not a valid type) for the field Test.Action

- Syntax error on token ",", delete this token.

public class Test

{

enum Action {refresh, reTurn, forward, success}

public static void main(String args[ ])

{

System.out.println(Action.refresh);

}

}

I can compile the class successful if i straight compile at JDK.

But why the eclipse can't make it(can't compile automatically)?

Thanks.

[727 byte] By [Kam_Hona] at [2007-10-1 5:48:18]
# 1
That version of Eclipse does not support Java 5.
ChuckBinga at 2007-7-9 14:02:17 > top of Java-index,Administration Tools,Sun Connection...
# 2
So, which version of eclipse support java 5? Is it eclipse 3.1?Thanks.
Kam_Hona at 2007-7-9 14:02:17 > top of Java-index,Administration Tools,Sun Connection...
# 3

I you are using Eclipse 3.0.1 and java 1.5 then u should make the eclpse understnad that u are suing latest version of java.

This can be done by editng the configuration in Eclipse

In the eclipe menu u can find

windows | preferences | java | Installed JREs

If u select the Installed JREs from the left side of the tree list, u can find a dialogue in the right side. There update the location of ur latest java version

Repeat the workflow that u have done

Now u wont get the error

Hope this helps :-)

Mailback if u have problem still

Cheers !!!!!!!!!!!

bkalysuna at 2007-7-9 14:02:17 > top of Java-index,Administration Tools,Sun Connection...
# 4
bkalysun:I am still seeing the problem after selecting the 1.5 JRE (it is the only JRE I have on this machine) with Eclipse 3.0.1Any further information will be greatly appreciatedThanks.
designsummita at 2007-7-9 14:02:17 > top of Java-index,Administration Tools,Sun Connection...
# 5
Resolved:Enum is a keyword in Java 5.0.Just renamed the variable enum to enum1
designsummita at 2007-7-9 14:02:17 > top of Java-index,Administration Tools,Sun Connection...