Just to add to Jesper's comment - check your project properties in Eclipse and see what jars are in your project that are missing when you run your script. Also, you could try printing the value of CLASSPATH from your script to check the paths/jars.
Also carefully check the shell script against the actual name of the class, because you may simply have misspelled it. Finally, the shell script uses an unqualified name for the class, but perhaps it is (as all classes should be) defined in a package, and you've left the package name off.
Well, this is the first time you're mentioning Tomcat, so of course that makes a difference -- is this a Web application? If so, the answers are going to be totally different, so let us know.
If it's not a Web application, then your CLASSPATH is quite wrong, far worse than just the default setting you'd get if CLASSPATH were entirely unset. You're telling Java that the only classes of interest will come from those two jars included in the JDK, which is surely not at all what you intend.
Anyway, let us know abot the Web application thing and we'll help you work this out.
Originally posted by Hubert Pernegger: no, I'm not using a gnu environment....
It was a kind of rhetorical question: the known answer to which is "yes, you surely are." Whether you know it or not, rather than using the Sun JVM, you're using the GNU "gcj" toolchain: hence the "gnu.gcj.runtime.SystemClassLoader" in the error message.
Again, you need to tell us first if this is a Web application or not -- it matters tremendously. But honestly, the answer is "no" -- even if it's not a Web application, there are other better ways than setting CLASSPATH.
where jar1.jar, jar2.jar, etc, are all the jars your application needs. This is assuming everything is in a jar, of course; otherwise there's a sometimes confusing way of adding directories where classes may be found.
The -classpath switch overrides the environment variable.
You've got two different "java" lines there. You want to put that -classpath switch, with its long argument, on the second java command line (removing the first altogether.) Put it before the name of the class -- i.e.,
Looks like you've got lots of extra newlines in there, breaking up the classpath. Please tell me you didn't do that because of the edit I did to your first post -- that was just so the formatting of this forum page wasn't all messed up by one enormous long line.