无法使用Ant v1.9.4和JDK8(CLI)进行编译

时间:2014-05-19 12:27:59

标签: ant java-8

我无法使用JDK8 & Ant v1.9.4 with CLI进行编译。

build.xml

<?xml version="1.0" ?>
<project default="Compile">
    <target name="Compile">
        <mkdir dir="classes"/>
        <javac
            srcdir="src"
            includes="**/*.java"
            destdir="classes"
            source="1.8"
            target="1.8"
            debug="false">
        </javac>
    </target>       
</project>

class

import sun.security.tools.keytool.CertAndKeyGen;

public class AntProblem {

}

error

Buildfile:P:\ workspaces \ TEST \ AntProblem \ build.xml 编译:

[javac] P:\workspaces\TEST\AntProblem\build.xml:14: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

[javac] Compiling 1 source file to P:\workspaces\TEST\AntProblem\classes

[javac] P:\workspaces\TEST\AntProblem\src\AntProblem.java:1: error: package sun.security.tools.keytool does not exist

[javac] import sun.security.tools.keytool.CertAndKeyGen;

[javac]                                  ^

[javac] 1 error

当然包存在并且它在Eclipse中运行,但不适用于CLI!我只安装了这个JDK,没有其他版本,JAVA_HOME设置为JDK(不包括JRE)!

有什么建议吗?

非常感谢和最诚挚的问候 Wiesi;)

0 个答案:

没有答案