[5641] 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 (Franck Lantres)
Wed Feb 21 04:54:35 1996

Date: Wed, 21 Feb 1996 09:24:17 GMT
From: lantres@damas.seriat.fr (Franck Lantres)
To: java-interest@java.sun.com

> From daemon@java.sun.com  Wed Feb 21 09:09:53 1996
> Date: Tue, 20 Feb 1996 18:50:11 -0700
> From: Erik Sanchez <sancheze@rintintin.colorado.edu>
> Mime-Version: 1.0
> To: java-interest-digest@java.sun.com
> Subject: Re: Basic hello world program -fails
> Content-Transfer-Encoding: 7bit
> X-Info: To unsubscribe, send 'unsubscribe' to 
java-interest-request@java.sun.com
> 
> < 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?
> 
> I hope this is timely enough to help a fellow java novice. Also, this is my 
> first "reply" so if I'm doing something wrong someone PLEASE tell me.
> 
> Erik
> -
> This message was sent to the java-interest mailing list
> Info: send 'help' to java-interest-request@java.sun.com

  First, Erik said it, the first argument of java is the name of the class
which has the main or init method.
  Second, you must init the CLASSPATH variable (in autoexec.bat for Windows,
or in .cshrc for Solaris) with the directory containing the .class files.


---------------------------------------------------
    Franck LANTRES

    CERSIAT/BAE
    Fort de Bicetre
    BP 56
    94272 Le Kremlin Bicetre Cedex
    FRANCE

    tel   : (33 1) 45 15 37 59
    fax   : (33 1) 54 15 37 55
    email : lantres@seriat.fr
---------------------------------------------------
-
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