generics are not supported in -source 1.3

后端 未结 7 1219
太阳男子
太阳男子 2020-12-19 22:01

I have a problem while maven packaging. In this code:

public class LoginDialog extends Dialog {

    private final TextField customer;
                 


        
7条回答
  •  情话喂你
    2020-12-19 22:15

    Generics were added in java 1.5. Your maven is compiling for java 1.3.

    This can be fixed in one of two ways.

    Remove generics so that you can compile for < 1.5

    Change the maven configuration to compile for a newer version of java. You should be able to edit your compiler plugin in your pom:

            
                org.apache.maven.plugins
                maven-compiler-plugin
                3.0
                
                    1.5
                    1.5
                
            
    

    This tells maven to compile for 1.5

提交回复
热议问题