Tuesday, 15 January 2013

java - Issue with unrecognized option in ANT -



java - Issue with unrecognized option in ANT -

i have used quite bit of resources seek understand why gettting next error when attempting run ant command line:

unrecognized option: -dant.home=c:\ant\1.7.0 not create java virtual machine. error: file either empty or not contain valid choices.

to give little insight, have path include %java_home% , %ant_home%\bin. 1 of things cannot run administrator update scheme variables, user variables. has run before? give thanks help!

edit: update, uncommented @echo off @ top of ant.bat , ran ant.bat show unrecognized alternative occured below:

c:\ant\1.7.0\bin>if not "" == "" goto runantwithjikes c:\ant\1.7.0\bin>if "no" == "no" goto runantnoclasspath c:\ant\1.7.0\bin>"c:\java\jdk1.6.0_03\bin\java.exe" -classpath "c:\ant\1.7.0\li b\ant-launcher.jar" "-dant.home=c:\ant\1.7.0" org.apache.tools.ant.launch.launch er unrecognized option: -dant.home=c:\ant\1.7.0 not create java virtual machine.

update: think after doing more research, has relate classpath variable trying resolve launcher.jar file. if has encountered in windows awesome if had thought of next do. also, not using custom ant library.

update: decided include little debugging page. okay, echo out rest of batch file after line 130:

microsoft windows [version 6.1.7601] copyright (c) 2009 microsoft corporation. rights reserved. c:\windows\syswow64>ant debug debug debug attempting execute ant java process c:\windows\syswow64>if "no" == "no" goto runantnoclasspath c:\windows\syswow64>"c:\program files (x86)\java\jdk1.7.0_04\bin\java.exe" -cla sspath "c:\ant\1.7.0\lib\ant-launcher.jar" "-dant.home=c:\ant\1.7.0" org.apache. tools.ant.launch.launcher unrecognized option: -dant.home=c:\ant\1.7.0 error: not create java virtual machine. error: fatal exception has occurred. programme exit. c:\windows\syswow64>rem check error code of ant build c:\windows\syswow64>if not "windows_nt" == "windows_nt" goto onerror c:\windows\syswow64>rem windows 9x way of checking error code. matches v ia brute force. c:\windows\syswow64>for %i in (1 10 100) set err%i= c:\windows\syswow64>set err1= c:\windows\syswow64>set err10= c:\windows\syswow64>set err100= c:\windows\syswow64>for %i in (0 1 2) if errorlevel %i00 set err100=%i c:\windows\syswow64>if errorlevel 000 set err100=0 c:\windows\syswow64>if errorlevel 100 set err100=1 c:\windows\syswow64>if errorlevel 200 set err100=2 c:\windows\syswow64>if 0 == 2 goto onerror200 c:\windows\syswow64>if 0 == 0 set err100= c:\windows\syswow64>for %i in (0 1 2 3 4 5 6 7 8 9) if errorlevel %i0 set err 10=%i c:\windows\syswow64>if errorlevel 00 set err10=0 c:\windows\syswow64>if errorlevel 10 set err10=1 c:\windows\syswow64>if errorlevel 20 set err10=2 c:\windows\syswow64>if errorlevel 30 set err10=3 c:\windows\syswow64>if errorlevel 40 set err10=4 c:\windows\syswow64>if errorlevel 50 set err10=5 c:\windows\syswow64>if errorlevel 60 set err10=6 c:\windows\syswow64>if errorlevel 70 set err10=7 c:\windows\syswow64>if errorlevel 80 set err10=8 c:\windows\syswow64>if errorlevel 90 set err10=9 c:\windows\syswow64>if "" == "" if 0 == 0 set err10= c:\windows\syswow64>for %i in (0 1 2 3 4 5 6 7 8 9) if errorlevel %i set err1 =%i c:\windows\syswow64>if errorlevel 0 set err1=0 c:\windows\syswow64>if errorlevel 1 set err1=1 c:\windows\syswow64>if errorlevel 2 set err1=2 c:\windows\syswow64>if errorlevel 3 set err1=3 c:\windows\syswow64>if errorlevel 4 set err1=4 c:\windows\syswow64>if errorlevel 5 set err1=5 c:\windows\syswow64>if errorlevel 6 set err1=6 c:\windows\syswow64>if errorlevel 7 set err1=7 c:\windows\syswow64>if errorlevel 8 set err1=8 c:\windows\syswow64>if errorlevel 9 set err1=9 c:\windows\syswow64>goto onerrorend c:\windows\syswow64>set ant_error=1 c:\windows\syswow64>for %i in (1 10 100) set err%i= c:\windows\syswow64>set err1= c:\windows\syswow64>set err10= c:\windows\syswow64>set err100= c:\windows\syswow64>rem bug id 32069: resetting undefined env variable alter s errorlevel. c:\windows\syswow64>if not "c:\program files (x86)\java\jdk1.7.0_04\bin\java.exe " == "" set _javacmd= c:\windows\syswow64>if not "" == "" set ant_cmd_line_args= c:\windows\syswow64>if "1" == "0" goto mainend c:\windows\syswow64>rem set homecoming code if not in nt. can se t c:\windows\syswow64>rem value of 1, it's improve nothing. c:\windows\syswow64>if not "windows_nt" == "windows_nt" echo 1 1>nul | selection /n /c:1 error: file either empty or not contain valid choices. c:\windows\syswow64>rem set errorlevel if running nt. c:\windows\syswow64>if "windows_nt" == "windows_nt" color 00 c:\windows\syswow64>goto omega c:\windows\syswow64>

of particular concern me part:

c:\windows\syswow64>"c:\program files (x86)\java\jdk1.7.0_04\bin\java.exe" -cla sspath "c:\ant\1.7.0\lib\ant-launcher.jar" "-dant.home=c:\ant\1.7.0" org.apache. tools.ant.launch.launcher

i read on manual apache should not alter class path, left alone.

the -d switch turns on debugging (it synonym -debug).

it looks wanted -d switch, defines value property i.e.,

-dant.home=c:\ant\1.7.0

you can see command line options typing:

ant -help

java windows ant

No comments:

Post a Comment