[5125] in java-interest

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

Compiler warning errors

daemon@ATHENA.MIT.EDU (kkobashi@ix13.ix.netcom.com)
Mon Jan 29 19:30:55 1996

From: kkobashi@ix13.ix.netcom.com
Date: Mon, 29 Jan 1996 01:24:50 -0800
To: java-interest@java.Eng.Sun.COM

I have attempted to build some of the demo applications on the
1.0 JDK release. I keep getting the following warning (for example)
compiling the blink example:

blink.java:13: Warning: Public class Blink must be defined in a file called
"Blink.java".

Also, when tryiing to compile a simple hello world example, the source does
compile but I don't get any output:

import java.applet.*;
import java.awt.*;

class HelloWorld extends Applet
{
   public void init()
      {
      resize(150,25);
      }
   public void paint(Graphics g)
      {
      g.drawString("Hello, World!", 50, 25);
      }
}

I get the run-time messages:

d:\java\dev\hello> appletviewer example1.html
thread applet-HelloWorld.class find HelloWorld
load: HelloWorld is not public or has no public constructor
java.lang.IllegalAccessException: HelloWorld
       at sun.applet.AppletPanel.run(AppletPanel.java:200)
       at java.lang.Thread.run(Thread.java:289)
java.lang.NullPointerException
       at sun.applet.AppletPanel.run(AppletPanel.java:229)
       at java.lang.Thread.run(Thread.java:289)

When I do put in the public keyword before the class keyword above,
I get the same compiler error as the blink demo example.

Is my environment setup incorrectly?

-
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