Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic jar question

Status
Not open for further replies.

keenanbr

Programmer
Oct 3, 2001
469
IE
I have created a jar file;

There is just one class in it called XMLUtils

My manifest is ;
Code:
Manifest-Version: 1.0
Class-Path: ".;C:\Documents and Settings\a995085\.m2\repository\commons-io\commons-io\1.4\commons-io-1.4.jar"
Main-Class: XMlUtils

When I run as;
Code:
java -jar XMLUtils.jar C:/47670436.xml C:/Scenario6.xml C:/BK1.xml

i get;

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
at XMlUtils.removeNS(XMlUtils.java:286)
at XMlUtils.main(XMlUtils.java:304)


if i run it in a batch file thus;

Code:
echo off
cd projects\XMLUtils\bin\
SET CLASSPATH=".;C:\Documents and Settings\a995085\.m2\repository\commons-io\commons-io\1.4\commons-io-1.4.jar"
java -cp %CLASSPATH% XMlUtils C:/47670436.xml C:/Scenario6.xml C:/BK1.xml

it works fine.

I presume I doing something silly but what?

Any help appreciated.

Regards

 
I think you have to remove quotes and semicolon
Code:
Class-Path: . C:\Documents and Settings\a995085\.m2\repository\commons-io\commons-io\1.4\commons-io-1.4.jar
I also think you don't need the .
Take a look at this

Cheers,
Dian
 
Thanks for your suggestion. I got it working with ;
Code:
Manifest-Version: 1.0
Class-Path: /projects/XMLUtils/bin /Docume~1/a995085/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
Main-Class: XMlUtils

Regards,

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top