Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help me!

 
ansen chen
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why i enter the "ant" command,it shows the follow message:
D:\bank>ant all
Usage: java [-options] class [args...]
(to execute a class)
or java -jar [-options] jarfile [args...]
(to execute a jar file)
where options include:
-hotspot to select the "hotspot" VM
-server to select the "server" VM
-classic to select the "classic" VM
If present, the option to select the VM must be fi
The default VM is -hotspot.
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resour
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-showversion print product version and continue
-? -help print this help message
-X print help on non-standard options
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing to do with J2EE but rather belongs in the Jakarta forum so I am moving it there.
 
ansen chen
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you!I hava known the answer.I forget to add the ant.jar and parser.jar into my classpath.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ansen chen:
thank you!I hava known the answer.I forget to add the ant.jar and parser.jar into my classpath.

Are you sure? If ant.jar isn't in the classpath you should get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/Main
 
timothy zimmerman
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is odd. I would agree with Thomas that if you did not have ant.jar in your classpath you wold not even get as far as you seem to have gotten.
My first thought was that you had a target whihc was trying to execute the built in java task and not passing it correct arguments but I cannot duplicate that.
My second thought is htat you are tyring to execute the java command using the built in exec task? If this is the case perhaps your problem is there?
If you post the target which is giving you thin problem that may help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic