source 1.3 中不支持泛型 解决办法
来源:互联网 发布:qq的smtp服务器端口 编辑:程序博客网 时间:2024/05/18 02:04
原文地址:http://greenlight.blog.51cto.com/3159513/687547
maven打包时始终出现以下提示:
1、-source 1.3 中不支持泛型(请使用 -source 5 或更高版本以启用泛型)List<User> userList= new ArrayList<User>();
2、-source 1.3 中不支持注释(请使用 -source 5 或更高版本以启用注释)@WebService(endpointInterface = "com.webservice.service.LoadService")
而用命令mvn -v查看结果:
C:\Users\Administrator>mvn -vApache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
Java version: 1.6.0
Java home: D:\Program Files\Java\jdk1.6.0\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows vista" version: "6.1" arch: "x86" Family: "windows"
显然与所配置的JDK无关。
最终解决办法:
在项目的pom.xml中,添加
<build><plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
再执行mvn install,OK。
-------------------------------------------------华丽的分割线------------------------------------------------笔者遇到这个问题,通过对比其他pom,发现在出问题的pom文件中缺少了以下信息:
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.4.3</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>2.4.3</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.3.1</version>
- <configuration>
- </configuration>
- </plugin>
- </plugins>
- </build>
0 0
- source 1.3 中不支持泛型 解决办法
- source 1.3 中不支持泛型 解决办法
- source 1.3 中不支持泛型 解决办法
- maven source 1.3 中不支持泛型 解决办法
- Tomcat5报错:-source 1.3 中不支持泛型
- maven 出现 -source 1.3中不支持泛型的错误
- 解决办法:IntelliJ Java:-source 1.3中不支持,使用-source 5 或更高的版本一启用
- 解决办法:IntelliJ Java:-source 1.3中不支持,使用-source 5 或更高的版本一启用
- source 1.3中不支持泛型。(请尝试使用-source 1.5以启用泛型)
- mvn -source 1.3中不支持增强型 for循环
- 错误: -source 1.6 中不支持 diamond 运算符的解决办法
- 错误: -source 1.5 中不支持 diamond 运算符的解决办法
- maven编译时出现-source 1.3 中不支持泛型 (请尝试使用 -source 1.5 以启用泛型)
- tomcat版本引发的问题-source 1.3中不支持泛型
- maven打包时出现【java source 1.3中不支持泛型 请使用 -source 5 或更高版本以启用泛型】错误时的解决方法
- source 1.5 中不支持 diamond
- idea 提示:-source 1.6 中不支持 diamond 运算符的解决办法
- Maven 编译时报错 -source 1.5 中不支持 multi-catch 语句 的解决办法
- 基于jQuery.i18n.properties 实现前端页面的资源国际化
- lamp环境下安装Zabbix环境
- UILabel设置多种字体、颜色 (NSMutableAttributedString)
- java 图片读写
- oracle XE精简版不支持FETCH FIRST 5 ROWS ONLY语句
- source 1.3 中不支持泛型 解决办法
- 《iOS总结》UITableViewCell的增加与删除-MickyChiang
- linux中sd卡驱动(2)
- [.Net码农]RDLC报表打印时提示 客户端无法加载打印控件的问题
- Hadoop单机伪分布式配置
- android:强大的图片下载和缓存库Picasso
- 基于zookeeper的分布式Queue
- [.Net码农]RDLC打印控件失败
- 1075 - Incorrect table definition;there can be only one auto column and it must be defined as a key