Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

running jar file error:

 
Aiping Zhou
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am new to ant. Thank in advance for any helps.
My problem is I can not run my java file "hello.class" by using the jar file construct by ant build.xml. However I can successfully run it by using my .class file directly.
The error message prompt by ant like this:

Here is my build.xml using my jar to run:

Hoever, it runs fine while I directly run the .class file under my "myclass" folder using the following code:

Any one? Thanks again.
[ February 18, 2004: Message edited by: Aiping Zhou ]
 
Tony Yan
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure Hello is spelled right. Case Sensitivity problem?
 
Aiping Zhou
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried both, the results are same.
 
Tony Yan
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure. First make sure that the jar file in ${build} does contain your hello.class file in the right path ( root if default-packaged). Then, may be trying some different format of java task, like this:
<java classname="test.Main">
<arg value="-h"/>
<classpath>
<pathelement location="dist/test.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic