[5655] in java-interest

home help back first fref pref prev next nref lref last post

Re: Basic hello world program -fails

daemon@ATHENA.MIT.EDU (eric@onshore.com)
Wed Feb 21 12:32:58 1996

From: eric@onshore.com
Date: Wed, 21 Feb 1996 09:53:08 -0600
To: Erik Sanchez <sancheze@rintintin.colorado.edu>,
        java-interest-digest@java.sun.com

At 06:50 PM 2/20/96 -0700, Erik Sanchez wrote:
>< I recently bought the book "Teach yourself Java in 21 days", and am
>< experiencing a problem immediately at the beginning of the book. The basic
>< "Hello World" program compiles fine, but when I try to execute it with 
>< "java HelloWorld", I get an error that says "can't find class/HelloWorld 
>< class". What gives?
>
>Charles, I just bought the same book today and after working through the 
>first "day," I thought about your question.  First of all, put the HelloWorld 
>in quotes. Like this: java "HelloWorld" Since the class name is more than 8 
>characters some dos apps have a hard time with it.  Secondly, don't include 
>the .class extension or else you'll get the same error message.  One more 
>thing, I can't get the HelloWorldApplet to work (mine or the supplied code). 
>It compiles but won't display on netscape or the appletviewer. I can however 
>get the second day app to work etc.. go figure?

Hi,

I know that the problems that I had initially we're that the "case" needed
to match on the filename and the classname, so "class Helloworld" in
filename "helloworld.java" wouldn't fly.

Also, make sure that your classpath variable is set

and, I've seen lots of people use the "codebase" tag in Netscape.

Eric

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post