Originally posted by Marilyn deQueiroz:
I have loaded my class in a web browser
Why are you trying to run an application in a web browser rather than from the command line?
It's place is in a web browser. It should appear in a web page.
An Applet is a different animal than an Application. An applet extends java.applet.Applet. Your application does not. An applet doesn't need a main() method like your application has.
Will you be kind, sheriff, to explain this to me? It should be an Application to run in a web browser? what's the good of an Applet, then?
Try opening a "dos window" and type "java Hello" for a better chance to see results.
Did that. Look what I got:
Exception in
thread "main" java.lang.NoClassDefFoundError: hello (wrong name: Hello)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
What you say? The error output is longer than my listing. I have to be bad, bad, bad...
Regarding "the default access level, which us package", he meant "the default access level, which is package access." (I don't think that will help you, but changing it to public won't hurt anything either.)
Regarding your name, "RH" is an acceptable first name. Pick a different last name, or use your real last name. Also, I think you should be able to register with and use "Robert H" as your first name if you wish. I login with "Marilyn deQueiroz" and my display name is "Marilyn de Queiroz".
was taken! By the way, nice name!
Regards
Robert H