Java NoClassDefFoundError

Daniel Steinmann daniel.steinmann@insonic.com
Tue Aug 28 07:22:00 GMT 2001


Tait, Allen wrote:
> Having a problem executing a java program in a .sh file when running the .sh
> in Cygwin.  The following code snip is part of a larger .sh file that was
> written for the Solaris env.  I am trying to get it functioning on Windows
> NT.  Before calling "java", the script cd's to the directory where the java
> program is.  However, the call throws a "NoClassDefFoundError" exception.
> It can not find the class being called, (.org.jboss.Main).  I can execute
> this call on the command line and it works fine.  When the code is called
> inside of the .sh, it does not.  I have tried specifying the paths in
> -classpath as both full and relative paths.  Still no luck.  Has anyone else
> encountered a similar problem?

You have to invoke java with windows style path:

  CLASSPATH=.:run.jar:../lib/xerces.jar:../lib/crimson.jar

  # Convert path in case of cygwin
  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`

  java -classpath "$CLASSPATH" org.jboss.Main tomcat

HTH,
Daniel.

-- 
Daniel Steinmann, Insonic AG, Zuerich, Switzerland
daniel.steinmann@insonic.com, +41 1 317 88 99, fax: +41 1 317 88 90

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list