go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Syntax error, parameterized types are only available if source level is 5.0
 
Subject: Syntax error, parameterized types are only available if source level is 5.0
Author: EricJ
In response to: Syntax error, parameterized types are only available if source level is 5.0
Posted on: 11/29/2007 01:51:33 PM

A: Even though you have Java 5.0 installed, your JVM or your IDE's environment might run on different version.

Try typing this in the console window: java -version.
to double sure that your JVM is runnig on a correct one.

If you are using an IDE, in Eclipse for example, make sure:

  • Java 5.0 is installed (Window > Preferences > Java > Installed JREs)
  • The compiler compliance level is elected to 5.0 (Window > Preferences > Java > Compiler)

    Hope it helps.

     

    > On 11/29/2007 01:40:51 PM EricJ wrote:

    Q: I'm using Eclipse IDE to run a piece of standard code but I keep getting error like this:

    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    The type Map is not generic; it cannot be parameterized with arguments <String, SocketAddress>
    Syntax error, parameterized types are only available if source level is 5.0
    The type Queue is not generic; it cannot be parameterized with arguments <ServerSocketChannel>
    Syntax error, parameterized types are only available if source level is 5.0
    ...


    I've Java 5.0 installed, so what went wrong?





    References:

  •  


     
    Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
     
    Get your own forum today. It's easy and free.