MAVEN ERROR : Dynamic Web Module 3.0 requires Java 1.6 or newer
2016-05-09 14:13
501 查看
问题:
在eclipse中,通过Maven->Update Project更新项目后,出现Dynamic Web Module 3.0 requires Java 1.6 or newer错误提示,发现项目Java Compiler中的版本回到1.5。
原因:
其实在Maven官方文档中,Maven 3.0 source和target的默认设置都是1.5,与运行Maven时的JDK版本无关,除非在项目的POM文件中显示的指定一个版本,否则每次更新后都会使用编译器默认的source/target版本1.5。
解决方案:
在pom中指定JDK版本,在哪儿指定,compiler-plugin中。
在eclipse中,通过Maven->Update Project更新项目后,出现Dynamic Web Module 3.0 requires Java 1.6 or newer错误提示,发现项目Java Compiler中的版本回到1.5。
原因:
其实在Maven官方文档中,Maven 3.0 source和target的默认设置都是1.5,与运行Maven时的JDK版本无关,除非在项目的POM文件中显示的指定一个版本,否则每次更新后都会使用编译器默认的source/target版本1.5。
解决方案:
在pom中指定JDK版本,在哪儿指定,compiler-plugin中。
<!-- 官方文档 --> <!-- http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html --> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <!-- 指定source和target的版本 --> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build>
相关文章推荐
- Ibatis之3个不常用的Query方法
- [BS-16] 尽量将View的Opaque属性设置为YES(默认就是YES)
- DruidParser - 源代码篇(1)
- requestAnimationFrame/cancelAnimationFrame——性能更好的js动画实现方式
- 【Arduino官方教程第一辑】示例程序 3-2 模拟信号输入
- gradle 项目依赖的包太多导致不能build的异常
- CoreThink主题开发(九)使用H-ui开发博客主题之用户个人主页
- jsp页面从session和request域中取数据小结
- Android 中的消息模型(Message,MessageQueue,handle,looper)
- Codeforces 670E - Correct Bracket Sequence Editor 链表
- 64-Unique Binary Search Trees
- Arcengine 开发,FeatureClass新增feature时“The Geometry has no z-value”或"The Geometry has null z-value"的解决方案
- MUI-页面初始化
- Ultra-QuickSort--POJ2299(归并排序求逆序数对)
- UIButton setBackgroundImage与setImage区别
- UITabBarController使用
- android 你所不知道的类SpannableStringBuilder的总结--实现图文混排,查看更多,下划线等等
- Moqui之时间转换
- words in view Moqui resource code
- 区分Integer.getInteger和Integer.valueOf、Integer.parseInt() 的使用方法