[jcifs] NoClassDefFoundError Exception

James Fletcher fletcherj at lisd.net
Mon Oct 20 07:02:54 EST 2003

Hello Michael,

Unfortunately, it is not a classpath problem.  I am using jcifs within
a s1as7 web container which implements a java SecurityManager.  The code
at line 304 of SmbFile, which is 'Class.forName( "jcifs.Config" );' is
throwing the NoClassDefFoundError when the SecurityManager is enabled. 
Perhaps you can tell me what java permissions the jcifs package needs. 
I have temporarily solved the problem by disabling the SecurityManager. 
Any help in identifying the needed permissions would be helpful.

James Fletcher
fletcherj at lisd.net

>>> "Michael B Allen" <mba2000 at ioplex.com> 10/18/03 12:41PM >>>

> hello all,
> I am new to jcifs and I am tring to create a new SmbFile with:
> SmbFile aFile = new SmbFile( theSmb );
> Everything compiles fine, however when I run the code it returns a
> NoClassDefFoundError Exception.

When you run the 'java' command you will need to provide a 'classpath'.
UNIX you can just set the environment variable 'CLASSPATH' like:

$ export CLASSPATH=path/to/jcifs-0.7.14.jar:.
$ javac MyProgram.java
$ java MyProgram

There is a description of this in the README.txt file that comes with
jCIFS distribution package.

This is no different from any other Java application BTW.


A program should be written to  model the concepts of the task it
performs rather than the physical world or a process because this
maximizes the  potential for it  to be applied  to tasks that are
conceptually similar and, more  important, to tasks that have not
yet been conceived.

More information about the jcifs mailing list