ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikael Petterson <mikael.petter...@ericsson.com>
Subject RE: Run ant with java from Powershell
Date Wed, 09 Feb 2011 12:21:56 GMT
Hi,

Why not try:

java %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher
%ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS% 

-----Original Message-----
From: Gabriel Petrovay [mailto:gabipetrovay@gmail.com] 
Sent: den 9 februari 2011 13:07
To: user@ant.apache.org
Subject: Run ant with java from Powershell

Hi!

Did somebody manage to launch ant form the ant.jar with java? I cannot make it work. I must
include all the jars in a certain directory in the classpath.

Using java 6, I tried:

java -cp "D:\Software\webtest\lib\*" org.apache.tools.ant.Main

and I get:

Exception in thread "main" java.lang.NoClassDefFoundError:
D:\Software\webtest\lib\ant-1/7/0/jar
Caused by: java.lang.ClassNotFoundException:
D:\Software\webtest\lib\ant-1.7.0.jar
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)

So, probably "D:\Software\webtest\lib\*" gets expanded using spaces between the path items
instead of columns (;).


Any ideas?

Thanks!

--
MSc Gabriel Petrovay
Mobile: +41(0)787978034
www.28msec.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message