Anukool Lakhina wrote:
>
> Hello,
>
> I'm using JDK1.2.2 and JSDK2.1. So far, javac works great and compiles
> beautifully. But when I try and do java <ClassName>, I get the following
> error:
> "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld"
>
> I thought it was a bug in my servlet code, but then I noticed it happens
> even on the trivial HelloWorld example.  Even the demo applets that come
> with jdk1.2.2, don't run when invoked with java <APPLETNAME> (they compile
> ok). Funny thing is that when I run the applets using MS jview
> (C:\winnt\jview <APPLET_CLASS_NAME>), the applets run ok.
>
> Please help me so that I can go back to working on servlets without having
> to worry about issues like this. (Oh and I'm using a dual processor machine,
> NT box. Shouldn't change anything but perhaps this is causing the
> headaches?)

A servlet is not a standalone class that you can run with just the java
command. It needs to run in a servlet engine, like the one included with
JSDK 2.1, and be invoked from a browser through HTTP. Applets also need a
runtime environment, but in this case it's provided by the browser.

I suggest you spend a bit of time learning about servlet basics. It will
save you time in the long run. You can start with Sun's Tutorial, available
at http://java.sun.com/docs/books/tutorial/

--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to