Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/370.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java ant构建的问题_Java_Ant - Fatal编程技术网

Java ant构建的问题

Java ant构建的问题,java,ant,Java,Ant,可能重复: 使用ant构建项目时遇到以下问题: [echo] Using Java version 1.6. build-java-lib: make-jar: clean: [delete] Deleting directory C:\xxx\bin compile-src: [mkdir] Created dir: C:\xxx\bin [javac] Compiling 102 source files to C:\Users\xxx\Work\AndroidPro

可能重复:

使用ant构建项目时遇到以下问题:

[echo] Using Java version 1.6.
build-java-lib:
make-jar:
clean:
   [delete] Deleting directory C:\xxx\bin
compile-src:
    [mkdir] Created dir: C:\xxx\bin
    [javac] Compiling 102 source files to C:\Users\xxx\Work\AndroidProjects\xxxx\bin
    [javac] javac: invalid target release: 1.6
    [javac] Usage: javac <options> <source files>
    [javac] where possible options include:
    [javac]   -g                         Generate all debugging info
    [javac]   -g:none                    Generate no debugging info
    [javac]   -g:{lines,vars,source}     Generate only some debugging info
    [javac]   -nowarn                    Generate no warnings
    [javac]   -verbose                   Output messages about what the compiler is doing
    [javac]   -deprecation               Output source locations where deprecated APIs are used
    [javac]   -classpath <path>          Specify where to find user class files
    [javac]   -cp <path>                 Specify where to find user class files
    [javac]   -sourcepath <path>         Specify where to find input source files
    [javac]   -bootclasspath <path>      Override location of bootstrap class files
    [javac]   -extdirs <dirs>            Override location of installed extensions
    [javac]   -endorseddirs <dirs>       Override location of endorsed standards path
    [javac]   -d <directory>             Specify where to place generated class files
    [javac]   -encoding <encoding>       Specify character encoding used by source files
    [javac]   -source <release>          Provide source compatibility with specified release
    [javac]   -target <release>          Generate class files for specific VM version
    [javac]   -version                   Version information
    [javac]   -help                      Print a synopsis of standard options
    [javac]   -X                         Print a synopsis of nonstandard options
    [javac]   -J<flag>                   Pass <flag> directly to the runtime system

BUILD FAILED
[echo]使用Java 1.6版。
构建java库:
制作罐子:
清洁:
[删除]删除目录C:\xxx\bin
编译src:
[mkdir]已创建目录:C:\xxx\bin
[javac]将102个源文件编译为C:\Users\xxx\Work\AndroidProjects\xxxx\bin
[javac]javac:无效的目标版本:1.6
[javac]用法:javac
[javac]可能的选项包括:
[javac]-g生成所有调试信息
[javac]-g:none不生成调试信息
[javac]-g:{lines,vars,source}只生成一些调试信息
[javac]-nowarn不生成警告
[javac]-关于编译器正在执行的操作的详细输出消息
[javac]-使用不推荐的API的不推荐的输出源位置
[javac]-类路径指定在何处查找用户类文件
[javac]-cp指定在何处查找用户类文件
[javac]-sourcepath指定在何处查找输入源文件
[javac]-引导类路径覆盖引导类文件的位置
[javac]-extdirs覆盖已安装扩展的位置
[javac]-endorseddir覆盖已认可标准路径的位置
[javac]-d指定放置生成的类文件的位置
[javac]-编码指定源文件使用的字符编码
[javac]-源代码提供与指定版本的源代码兼容性
[javac]-目标生成特定VM版本的类文件
[javac]-版本信息
[javac]-帮助打印标准选项的概要
[javac]-X打印非标准选项的概要
[javac]-J直接传递到运行时系统
构建失败

有什么建议吗?

看起来像是一堆废话。确保javac本身(不仅仅是Ant)使用的是Java1.6。

需要了解一下您的构建。我如何确保javac使用的是Java1.6?对不起,这在另一个SO问题中得到了回答,所以我没有复制答案。释义:阅读关于javac任务的文章,并使用类似于:。