Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Assigning enum keys to EnumMap in Java 5

843793Apr 16 2005 — edited Jul 31 2005
First, the code snippet:
public class EnumSingleTest{

    public enum RUN_MODE {ONE, TWO};

    private Map<RUN_MODE, String> m = new EnumMap<RUN_MODE, String>(RUN_MODE.class); 
      // COMPILER ERROR HERE

    public EnumSingleTest() 
    { 
    }
}
I try to compile it using JBuilder 2005 (using Borland Make and javac), and it keeps giving me the error:
"EnumSingleTest.java": type parameter EnumSingleTest.RUN_MODE is not within its bound at line 20, column 51

However, when I run the same file on the command line using javac, it does NOT give me any errors
C:\temp\Java tests>which javac
/cygdrive/c/Program Files/Java/jdk1.5.0_02/bin/javac

C:\temp\Java tests>javac EnumSingleTest.java

C:\temp\Java tests>
I am clueless. Please help. I ve run out of ideas, and need to get this working asap.

Could this be a JBuilder 2005 problem? (Btw, the JDK in Jbuilder points to JDK 1.5 directory)

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2005
Added on Apr 16 2005
7 comments
196 views