蚂蚁javac任务出错:[javac]警告:[选项]引导程序类路径未与-source 1.6一起设置 [英] Ant javac task errs out: [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6

查看:275
本文介绍了蚂蚁javac任务出错:[javac]警告:[选项]引导程序类路径未与-source 1.6一起设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行一个使用axis2-ant-plugin-1.6.0.jar\org\apache\axis2\tool\ant\AntCodegenTask来执行WSDL2Java操作的蚂蚁任务.

I'm trying to run an ant task that uses axis2-ant-plugin-1.6.0.jar\org\apache\axis2\tool\ant\AntCodegenTask to perform a WSDL2Java operation.

在ant脚本的顶部,我定义java6.boot.classpath:

At the top of the ant script, I define java6.boot.classpath:

    <property name="java6.boot.classpath" value="${env.JAVA6_BOOT_CLASSES}"/>

我将JAVA6_BOOT_CLASSES环境变量设置为C:\dev\java\64-bit\jdk-1.6.0_45\bin.

And I have the JAVA6_BOOT_CLASSES environment variable set to C:\dev\java\64-bit\jdk-1.6.0_45\bin.

相关的蚂蚁目标如下:

<!-- dist.jar target -->
<target name="dist.jar" depends="generate"
    description="Creates the web services client jar file">
    <echo>Compiling web services client code</echo>

    <javac srcdir="${project.javapath}" destdir="${build}" 
           source="1.6" target="1.6" 
           debug="true" debuglevel="lines,vars,source" 
           excludes="com/company/junit/**"
           bootclasspath="${java6.boot.classpath}"
           includeantruntime="false">

        <classpath refid="compile.classpath" />
    </javac>

    <echo>Creating ${jarname}.jar</echo>
    <jar destfile="${dist}/${jarname}.jar" basedir="${build}" />
    <echo>${jarname}.jar created</echo>
</target>

但是,尝试运行该错误,我收到了标题错误:

Trying to run that, however, I receive the titular error:

 [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6  

有什么想法吗?我觉得我已经为Java 1.6适当设置了启动类路径,但是ant似乎不同意.

Any ideas? I feel like I've appropriately set the boot classpath for Java 1.6, but ant doesn't seem to agree.

推荐答案

这不是Ant,而是发出警告的JDK的javac.

This is not Ant but the JDK's javac emitting the warning.

如果您使用Java 7的javac和-source来处理小于7个javac的警告,则还应将引导程序类路径设置为指向较旧的rt.jar-因为这是确保结果可在旧版VM.

If you use Java 7's javac and -source for anything smaller than 7 javac warns you you should also set the bootstrap classpath to point to an older rt.jar - because this is the only way to ensure the result is usable on an older VM.

https://blogs.oracle.com/darcy/entry/bootclasspath_older_source

这只是一个警告,因此您可以忽略它,甚至可以通过

This is only a warning, so you could ignore it and even suppress it with

<compilerarg value="-Xlint:-options"/>

或者,您确实安装了较旧的JVM并相应地调整了引导类路径(您需要包含rt.jar而不是bin文件夹)

Alternatively you really install an older JVM and adapt your bootclasspath accordingly (you need to include rt.jar, not the bin folder)

这篇关于蚂蚁javac任务出错:[javac]警告:[选项]引导程序类路径未与-source 1.6一起设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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