Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <8F23E55D511AD5119A6800D0B76FDDE1CA30DA@cpex3.channelpoint.com> From: Troy Noble To: "'Tait, Allen'" , "'cygwin AT cygwin DOT com'" Subject: RE: Java NoClassDefFoundError Date: Tue, 28 Aug 2001 08:17:37 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Scanned-By: MIMEDefang 1.0 (http://www.roaringpenguin.com/mimedefang/) What does the first line of your script look like? #!/bin/sh is ideal. If it's empty and SHELL=bash or if it's #!/bin/bash then it may be invoking bash, which will cause your login scripts to get re-run by default. That might be resetting your CLASSPATH. Whereas if it's #!/bin/sh then the current set of environment variables (i.e. CLASSPATH) gets inherited by the child sh process when you run your script. Try that and see if it fixes it. That's how we run all our scripts here, and we run a lot of java from inside shell scripts. The other alternative is to explicitly setup your CLASSPATH once inside the script if you absolutely need functionality that /bin/bash provides above and beyond /bin/sh (which is ash by default, BTW). Troy -----Original Message----- From: Tait, Allen [mailto:atait AT IDEXX DOT com] Sent: Tuesday, August 28, 2001 8:09 AM To: 'cygwin AT cygwin DOT com' Subject: Java NoClassDefFoundError 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? I have installed Cygwin in e:\cygwin, and have not mounted a new root or any other directories. The web application, this script starts, includes Tomcat and Jboss. The application environment is installed in e:\cygwin, under /usr/local/....... So, when at the bash commend prompt I can type cd /usr and It brings me to the root of the application. .............. cd /usr/local/idexx/prod/jboss/bin java \ -server \ -Xbootclasspath/a:${PJA_HOME}/lib/pja.jar \ -Dawt.toolkit=com.eteks.awt.PJAToolkit \ -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment \ -Djava2d.font.usePlatformFont=false \ -Djava.awt.fonts=${JAVA_HOME}/jre/lib/fonts:${PJA_HOME}/lib/fonts \ -Duser.home=${PJA_HOME} \ -Dcom.idexx.vetconnect.smtpHost=mail.idexx-informatics.com \ -classpath $CLASSPATH:.:run.jar:../lib/xerces.jar:../lib/crimson.jar org.jboss.Main tomcat ............. -- 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/ -- 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/