我无法使用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;)