aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes running jar file error: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "running jar file error: " Watch "running jar file error: " New topic
Author

running jar file error:

Aiping Zhou
Greenhorn

Joined: Sep 06, 2003
Posts: 24
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

Joined: Apr 10, 2002
Posts: 170
Make sure Hello is spelled right. Case Sensitivity problem?


Tony Yan<br /> <br />IBM Certified Developer XML and Related Technology<br />Sun Certified Web Component Developer For J2EE Platform<br />Sun Certified Programmer For Java 2 Platform
Aiping Zhou
Greenhorn

Joined: Sep 06, 2003
Posts: 24
I tried both, the results are same.
Tony Yan
Ranch Hand

Joined: Apr 10, 2002
Posts: 170
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: running jar file error: