Results 1 to 5 of 5
  1. #1
    new_2_java is offline Member
    Join Date
    Feb 2008
    Posts
    60
    Rep Power
    0

    Default The type Class is not generic; it cannot be parameterized with arguments <T>

    Hi all,

    I have set up a project in Eclipse 3.1 and am using java 5.0 compiler.

    Here's my folder structure in Eclipse


    Java Code:
    DFS\RemoteClient\TestClient.java
    DFS is the project in Eclipse


    and this is how it looks my java class

    Java Code:
    package RemoteClient;
    
    import java.util.*;
    // other imports
    public class TestClient {
        public static void main(String [] args) throws ServiceInvocationException {
            // business logic here ....
        }
    }
    So, basically, my java class is just a simple class with a main function.

    Now when I build my project, using Project->Clean...

    Then I get this as an error at the very first line where i specify the package

    This is the error:

    Java Code:
    The type Class is not generic; it cannot be parameterized with arguments <T>
    Can someone please comment on this, as what's this error and why am I getting this.

    Thanks.

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    The type Class is not generic; it cannot be parameterized with arguments <T>
    It may be that your ide is using a version of java (earlier than j2se 1.5 in which generics was added to the language) which does not support generics. You can try removing the generic type parameters.

  3. #3
    kavishankarbe is offline Member
    Join Date
    Feb 2015
    Posts
    2
    Rep Power
    0

    Default Re: The type Class is not generic; it cannot be parameterized with arguments <T>

    If the List was proper with util.List. The solution was to order the exports of the libraries. If you are using Maven or any other Libraries :

    In Project -> Build Path -> Configure Build Path -> Order & Exports

    Check 'JRE System Libraries' should be above 'Maven Dependencies'

  4. #4
    kavishankarbe is offline Member
    Join Date
    Feb 2015
    Posts
    2
    Rep Power
    0

    Default Re: The type Class is not generic; it cannot be parameterized with arguments <T>

    I was getting exactly the same issue. The List was proper with util.List. The solution was to order the exports of the libraries. If you are using Maven or any other Libraries :

    In Project -> Build Path -> Configure Build Path -> Order & Exports

    Check 'JRE System Libraries' should be above 'Maven Dependencies'

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,420
    Rep Power
    7

    Default Re: The type Class is not generic; it cannot be parameterized with arguments <T>

    You are almost 7 years too late. Did you notice that dates of those posts?

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. A generic interface example
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-17-2008, 07:42 PM
  2. A simple generic class
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-17-2008, 07:41 PM
  3. Will struts work for parameterized message in internationlization
    By felixtfelix in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 04-04-2008, 01:32 PM
  4. Generic Hashtables
    By ShoeNinja in forum New To Java
    Replies: 0
    Last Post: 12-04-2007, 11:43 PM
  5. Creating object of Type Object class
    By venkatv in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 03:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •