jdk1.8下maven 设置jdk版本3.3.3报错版本不对.除了用jdk1.6,还有什么办法吗

eclipse指定jdk1.8,之后使用maven刷新jdk版本变为历史版本的问题 - jdk-maven-eclipse - ITkeyowrd
eclipse指定jdk1.8,之后使用maven刷新jdk版本变为历史版本的问题
推荐:Maven默认JDK好像是1.5,所以需要另行指定。 &build& &plugins& &plugin& &groupId&org.apache.maven.plugins&/groupId& &artifactId&maven-compiler-plugin&/ar
领取地址:
今天要将一个项目的jdk由1.6的版本变更为1.8的版本。
我将eclipse的Preference -& Java -& Instanled JREs 里面的jdk改为jdk1.8,将Preference -& Java -& Compiler 里面的1.6改为1.8.
为了让项目在eclipse里面刷新,我使用快捷键“ALT + F5”刷新了项目。结果,我发现eclipse的Instanled JREs&和Compiler&有变更为jdk1.6 。我以为eclipse有啥问题呢,重复尝试了好几次,发现还是这个样子。
于是乎我就去万能的Google搜索了一下。发现了有人和我遇到了同样的问题。
地址如下:
内容如下:
------------------------------------------------------------------------------------------------------------------------------
I'm using Eclipse EE 3.7 with m2e plugin installed. I have JDK7 set in eclipse. When I import maven projects, the JRE is set to&JRE System Library [J2SE-1.5], So i have compilation issues with java 6 related stuff. Instead I want the JRE in eclipse to be by default set to JRE&System Library [J2SE-1.6]
When i try to open a new project in eclipse File -& new -& Java project on the first screen i have an option to choose JRE and the third option is&Use default JRE (currently 'jdk1.7.0_03')
From this i can see that the default JRE in Eclipse is 1.7, but when i import new Maven projects, the JRE is set to 1.5 by default.
Any help, how can i do this?
& & asked& Mar 29 '12 at 13:53
1,191 1 11 19 & && & I am experiencing a similary problem. Whatever the JRE System Library is set to, performing a Project&Maven&Update Project... resets the JRE System Library to J2SE-1.5.&–&
The problem is not with Eclipse, but with the projects you're importing. m2e will set the project's JRE to match the maven project. The POM specifies the JRE version, and this is defaulted to 1.5 if not present. You need this in the POM:
&build&&plugins&&plugin&&groupId&org.apache.maven.plugins&/groupId&&artifactId&maven-compiler-plugin&/artifactId&&version&3.0&/version&&configuration&&source&1.7&/source&&target&1.7&/target&&/configuration&&/plugin&&/plugins&&/build&
& & answered& Mar 29 '12 at 14:14
22.9k 4 37 65 & && & It works, thanks&–&
&is some more info from Maven site&–&
&& & for people who have more than one project this question could also be of interest
&& & I put it in &build&&plugins&&/plugins&&/build& of pom file. It works, thanks!&–&
artbristol gave the correct answer (and I upvoted him).
That was in 2012. Here is an update more appropriate for today (2016, Java 8, Spring 4.x/Servlet 3.x):
&plugin&&groupId&org.apache.maven.plugins&/groupId&&artifactId&maven-compiler-plugin&/artifactId&&version&3.0&/version&&configuration&&source&1.7&/source&&target&1.7&/target&&/configuration&&/plugin&
answered& Feb 10 at 5:10
54.2k 6 64 89 &
------------------------------------------------------------------------------------------------------------------------------
按照上面的提示,我将项目的pom.xml的
& & &groupId&org.apache.maven.plugins&/groupId&
& & &artifactId&maven-compiler-plugin&/artifactId&
& & &version&${maven-compiler-plugin.version}&/version&推荐:之前使用Maven的时候,就发现,新建项目的时候使用的JDK版本类型有问题总是和Eclipse中的默认版本类型不一致,需要手动去修改, 最近又在使用,真心受不了了,应
& & &configuration&
& & & & &source&1.6&/source&
& & & & &target&1.6&/target&
& & & & &encoding&UTF-8&/encoding&
& & &/configuration&
修改一下就好了。如下:
& & &groupId&org.apache.maven.plugins&/groupId&
& & &artifactId&maven-compiler-plugin&/artifactId&
& & &version&${maven-compiler-plugin.version}&/version&
& & &configuration&
& & & & &source&1.8&/source&
& & & & &target&1.8&/target&
& & & & &encoding&UTF-8&/encoding&
& & &/configuration&
推荐:maven是个项目管理工具,如果我们不告诉它我们的代码要使用什么样的jdk版本编译的话,它就会用maven-compiler-plugin默认的jdk版本来进行处理,这样就容易出现版
今天要将一个项目的jdk由1.6的版本变更为1.8的版本。 我将eclipse的Preference -& Java -& Instanled JREs 里面的jdk改为jdk1.8,将Preference -& Java -& Compiler 里面的1.6改为1.8. 为了让
相关阅读排行
相关内容推荐
请激活账号
为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。
您的注册邮箱:
如果您没有收到激活邮件,请注意检查垃圾箱。关于Maven3.3.9在JDK1.8报错的问题
[问题点数:40分]
本版专家分:0
CSDN今日推荐
匿名用户不能发表回复!|
CSDN今日推荐&>&支持jdk1.6的maven版本
支持jdk1.6的maven版本
上传大小:7.7MB
支持jdk1.6的最高maven版本。由于tomcat官网现在只有最新的maven版本下载入口,所以找jdk1.6的maven有点麻烦,亲测可用
综合评分:0
{%username%}回复{%com_username%}{%time%}\
/*点击出现回复框*/
$(".respond_btn").on("click", function (e) {
$(this).parents(".rightLi").children(".respond_box").show();
e.stopPropagation();
$(".cancel_res").on("click", function (e) {
$(this).parents(".res_b").siblings(".res_area").val("");
$(this).parents(".respond_box").hide();
e.stopPropagation();
/*删除评论*/
$(".del_comment_c").on("click", function (e) {
var id = $(e.target).attr("id");
$.getJSON('/index.php/comment/do_invalid/' + id,
function (data) {
if (data.succ == 1) {
$(e.target).parents(".conLi").remove();
alert(data.msg);
$(".res_btn").click(function (e) {
var parentWrap = $(this).parents(".respond_box"),
q = parentWrap.find(".form1").serializeArray(),
resStr = $.trim(parentWrap.find(".res_area_r").val());
console.log(q);
//var res_area_r = $.trim($(".res_area_r").val());
if (resStr == '') {
$(".res_text").css({color: "red"});
$.post("/index.php/comment/do_comment_reply/", q,
function (data) {
if (data.succ == 1) {
var $target,
evt = e || window.
$target = $(evt.target || evt.srcElement);
var $dd = $target.parents('dd');
var $wrapReply = $dd.find('.respond_box');
console.log($wrapReply);
//var mess = $(".res_area_r").val();
var mess = resS
var str = str.replace(/{%header%}/g, data.header)
.replace(/{%href%}/g, 'http://' + window.location.host + '/user/' + data.username)
.replace(/{%username%}/g, data.username)
.replace(/{%com_username%}/g, data.com_username)
.replace(/{%time%}/g, data.time)
.replace(/{%id%}/g, data.id)
.replace(/{%mess%}/g, mess);
$dd.after(str);
$(".respond_box").hide();
$(".res_area_r").val("");
$(".res_area").val("");
$wrapReply.hide();
alert(data.msg);
}, "json");
/*删除回复*/
$(".rightLi").on("click", '.del_comment_r', function (e) {
var id = $(e.target).attr("id");
$.getJSON('/index.php/comment/do_comment_del/' + id,
function (data) {
if (data.succ == 1) {
$(e.target).parent().parent().parent().parent().parent().remove();
$(e.target).parents('.res_list').remove()
alert(data.msg);
//填充回复
function KeyP(v) {
var parentWrap = $(v).parents(".respond_box");
parentWrap.find(".res_area_r").val($.trim(parentWrap.find(".res_area").val()));
评论共有1条
看看能不能兼容
leiqiongjiecn
综合评分:
积分/C币:15
综合评分:
积分/C币:2
VIP会员动态
热门资源标签
CSDN下载频道资源及相关规则调整公告V11.10
下载频道用户反馈专区
下载频道积分规则调整V1710.18
spring mvc+mybatis+mysql+maven+bootstrap 整合实现增删查改简单实例.zip
资源所需积分/C币
当前拥有积分
当前拥有C币
输入下载码
为了良好体验,不建议使用迅雷下载
支持jdk1.6的maven版本
会员到期时间:
剩余下载个数:
剩余积分:0
为了良好体验,不建议使用迅雷下载
积分不足!
资源所需积分/C币
当前拥有积分
您可以选择
程序员的必选
绿色安全资源
资源所需积分/C币
当前拥有积分
当前拥有C币
为了良好体验,不建议使用迅雷下载
资源所需积分/C币
当前拥有积分
当前拥有C币
为了良好体验,不建议使用迅雷下载
资源所需积分/C币
当前拥有积分
当前拥有C币
您的积分不足,将扣除 10 C币
为了良好体验,不建议使用迅雷下载
无法举报自己的资源
你当前的下载分为234。
你还不是VIP会员
开通VIP会员权限,免积分下载
你下载资源过于频繁,请输入验证码
您因违反CSDN下载频道规则而被锁定帐户,如有疑问,请联络:!
若举报审核通过,可返还被扣除的积分
被举报人:
举报的资源分:
请选择类型
资源无法下载 ( 404页面、下载失败、资源本身问题)
资源无法使用 (文件损坏、内容缺失、题文不符)
侵犯版权资源 (侵犯公司或个人版权)
虚假资源 (恶意欺诈、刷分资源)
含色情、危害国家安全内容
含广告、木马病毒资源
*详细原因:
支持jdk1.6的maven版本博客分类:
今天要将一个项目的jdk由1.6的版本变更为1.8的版本。
我将eclipse的Preference -& Java -& Instanled JREs 里面的jdk改为jdk1.8,将Preference -& Java -& Compiler 里面的1.6改为1.8.
为了让项目在eclipse里面刷新,我使用快捷键“ALT + F5”刷新了项目。结果,我发现eclipse的Instanled JREs 和Compiler 有变更为jdk1.6 。我以为eclipse有啥问题呢,重复尝试了好几次,发现还是这个样子。
于是乎我就去万能的Google搜索了一下。发现了有人和我遇到了同样的问题。
地址如下:
内容如下:
------------------------------------------------------------------------------------------------------------------------------
I'm using Eclipse EE 3.7 with m2e plugin installed. I have JDK7 set in eclipse. When I import maven projects, the JRE is set to JRE System Library [J2SE-1.5], So i have compilation issues with java 6 related stuff. Instead I want the JRE in eclipse to be by default set to JRE System Library [J2SE-1.6]
When i try to open a new project in eclipse File -& new -& Java project on the first screen i have an option to choose JRE and the third option is Use default JRE (currently 'jdk1.7.0_03')
From this i can see that the default JRE in Eclipse is 1.7, but when i import new Maven projects, the JRE is set to 1.5 by default.
Any help, how can i do this?
1,19111119
The problem is not with Eclipse, but with the projects you're importing. m2e will set the project's JRE to match the maven project. The POM specifies the JRE version, and this is defaulted to 1.5 if not present. You need this in the POM:
&build&&plugins&&plugin&&groupId&org.apache.maven.plugins&/groupId&&artifactId&maven-compiler-plugin&/artifactId&&version&3.0&/version&&configuration&&source&1.7&/source&&target&1.7&/target&&/configuration&&/plugin&&/plugins&&/build&
22.9k43765
artbristol gave the correct answer (and I upvoted him).
That was in 2012. Here is an update more appropriate for today (2016, Java 8, Spring 4.x/Servlet 3.x):
&plugin&&groupId&org.apache.maven.plugins&/groupId&&artifactId&maven-compiler-plugin&/artifactId&&version&3.0&/version&&configuration&&source&1.7&/source&&target&1.7&/target&&/configuration&&/plugin&
54.2k66489
------------------------------------------------------------------------------------------------------------------------------
按照上面的提示,我将项目的pom.xml的
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-compiler-plugin&/artifactId&
&version&${maven-compiler-plugin.version}&/version&
&configuration&
&source&1.6&/source&
&target&1.6&/target&
&encoding&UTF-8&/encoding&
&/configuration&
修改一下就好了。如下:
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-compiler-plugin&/artifactId&
&version&${maven-compiler-plugin.version}&/version&
&configuration&
&source&1.8&/source&
&target&1.8&/target&
&encoding&UTF-8&/encoding&
&/configuration&
kanpiaoxue
浏览: 718758 次
来自: 北京
lixz 写道有具体实例demo吗好多年前写的了。你还是去官网 ...
有具体实例demo吗
理解错了,原来还是计数,不是时间
TimeoutTerminationPolicy 是毫秒 默认 ...
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'

我要回帖

更多关于 maven jdk版本 的文章

 

随机推荐