Java Tutorial/Hello World!: Difference between revisions

Content deleted Content added
Sigma 7 (discuss | contribs)
Remove error that someone posted; the instructions to get around the error were already posted on the page.
Line 28:
<code>java HelloWorld</code>
 
Do not add the ".class" extentextention to the name,; the Java programinterpreter figureswill thisalready outbe forable to locate the file based on the class name you provided, and youadding the extention incorrectly will justsimply confuse it.
 
error:
<p style="text-align:left;">
Exception in thread "main" java.lang.NoClassDefFoundError: /var/www/html/HelloWorld/class
Caused by: java.lang.ClassNotFoundException: .var.www.html.HelloWorld.class
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
Could not find the main class: /var/www/html/HelloWorld.class. Program will exit.</p>
 
== Line-by-line analysis ==