未知参数:-cp ANT1.9.1

时间:2013-05-25 04:17:11

标签: java windows ant

我的操作系统是Win7,我下载ant-1.9.1 ant解压缩到d:\ 在我设置ANT_HOME之后,在CMD I GOT中运行以下错误:

C:\Users\hp>ant
Unknown argument: -cp
ant [options] [target [target2 [target3] ...
Options:
-help, -h              print this message

以下是我的操作系统设置:

C:\Users\hp>javac -version
 javac 1.7.0_15
C:\Users\hp>java -version
 java version "1.7.0_15"
 Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
 Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)

C:\Users\hp>path
PATH=D:\apache-ant-1.9.1\bin;D:\Python27;E:\Develop\Android\android-sdk-windows\
platform-tools\;E:\Develop\Android\android-sdk-windows\tools\;C:\Program Files (
x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files
(x86)\Java\jdk1.7.0_15\bin;C:\Program Files\Common Files\Microsoft Shared\Window
s Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Prog
ram Files (x86)\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows
\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Inte
l\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files
(x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\
Shared;%JAVA_HOME%\bin;D:\Program Files\TortoiseSVN\bin;D:\Program Files\Tortois
eHg\;

C:\Users\hp>echo %classpath%
.;C:\Program Files (x86)\Java\jdk1.7.0_15\lib\dt.jar;C:\Program Files (x86)\Java
 \jdk1.7.0_15\lib\tools.jar;

 C:\Users\hp>echo %ANT_HOME%
 D:\apache-ant-1.6.1

我看过Unknown argument -cp : Spurious errors with Anthttp://marc.info/?l=ant-user&m=113074222502480 虽然我认为这些帖子与我的问题无关! 任何人都可以帮忙吗?

1 个答案:

答案 0 :(得分:1)


前段时间我也遇到过这样的问题 为我完成工作的解决方案是编辑 ant.bat 文件(在那里传递给jre的一些参数在我的配置上不起作用)

KR 弗洛里安