
when i run a simple program on package it shows error my program is
package world;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
i ve stored it in c:\world
so i compile it by
c:\world> javac HelloWorld.javaprint("code sample");
it compiles succesfully but when i do c:\world>java world.HelloWorld
it shows the foll error
Caused by: java.lang.ClassNotFoundException: world.HelloWorld at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Could not find the main class: world.HelloWorld. Program will exit.
plzzz help

try running using the following: c:\world>java HelloWorld
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.