Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Basic jar question

Basic jar question

Basic jar question

I have created a jar file;

There is just one class in it called XMLUtils

My manifest is ;


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;


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;


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.



RE: Basic jar question

I think you have to remove quotes and semicolon


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


RE: Basic jar question

Thanks for your suggestion. I got it working with ;


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



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close