[thelist] Java: basic help?

Frank framar at interlog.com
Thu Sep 19 19:19:01 CDT 2002


I'm trying to run my very first java code. I'm still at the
stage where I'm typing in line for line from tutorials, and
I don't know what I don't know yet. I do know that I've
typed this in quite correctly.

Here is my code:

class HelloWorld {
      public static void main (String args[]) {
      System.out.println("Hello, World");
   }
}


It seems to compile correctly, I get a class out of it, and no
errors seem to show up. When I try to run it, I get an error:

----
load: HelloWorld.class is not public or has no public constructor.
java.lang.IllegalAccessException: Class sun.applet.AppletPanel can
not access a member of class HelloWorld with modifiers ""
---

I'm using j2sdk-1_4_1-windows-i586, Win2K and a plain old text
editor at the moment. My java folder is at C:\Java, and the document
is at C:\JavaProjects\HelloWorld(.java, .class)

Seeing as this is my first foray into it, I'm kind of unexcited
about my initial attempts. Can someone offer a suggestion as to
where I might have gone wrong?

Another thing: How do I register javac to run from the
start-> run without having to add the entire path?


Thanks.


--
Frank Marion
frank at frankmarion.com






More information about the thelist mailing list