引导类路径未与-source 1.6一起设置 [英] bootstrap class path not set in conjunction with -source 1.6

查看:813
本文介绍了引导类路径未与-source 1.6一起设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的应用程序从Java 1.6升级到1.7.当我尝试使用Maven 3.2.1进行构建时,构建失败,并显示以下错误消息:

I am upgrading my application from java 1.6 to 1.7. When I try to build using Maven 3.2.1, my build fails with below error msg:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project my-app5: Compilation failure: Compilation failure:
[ERROR] could not parse error message: warning: [options] bootstrap class path not set in conjunction with -source 1.6  

我使用的是Java 1.7热点,以前我使用的是1.6 jrockit.我的应用程序是多模块,很少有模块像往常一样编译和构建,该模块失败了.

I am using java 1.7 hotspot and previously I was using 1.6 jrockit. My application is multi module and few modules compile and build as usual, this module failed.

我已经正确设置了Java home,并且 mvn --version 显示如下输出:

I have set java home properly and mvn --version shows below output:

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T23:07:52+05:30)
Maven home: C:\Users\me\Maven3\apache-maven-3.2.1-bin\apache-maven-3.2.1\bin\..
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: C:\Program Files\jdk17051\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"  

我错过了什么吗?

推荐答案

我在编译器插件中使用以下配置解决了该问题

I solved it using below configuration in my compiler plugin

<fork>true</fork>
<executable>${JAVA_HOME}/bin/javac</executable>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>  

这将使用您在JAVA_HOME环境属性中定义的jdk

This will use the jdk which you have defined in your JAVA_HOME environment property

这篇关于引导类路径未与-source 1.6一起设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆