Wait for one day I am installing windows to solve this issue. Can't understand as path is showing bin in the path.
Wait for one day I am installing windows to solve this issue. Can't understand as path is showing bin in the path.
hey luke, sorry i forgot to update here, nandini's method is working fine. now both javac and java command are working from cmd.
thanks for your help.
meanwhile what is wrong in this code ?
Saved as MyFirstApp.java.public class MyFirstApp
{
public static void main ()
{
System.out.println("I rule ");
System.out.println("the world.");
}
}
NO problems in compiling , but in execution i get this error.
F:\Documents and Settings\Administrator\Desktop>java MyFirstApp
Exception in thread "main" java.lang.NoSuchMethodError: mainF:\Documents and Settings\Administrator\Desktop>java MyFirstApp.class
Exception in thread "main" java.lang.NoClassDefFoundError: MyFirstApp/class
Caused by: java.lang.ClassNotFoundException: MyFirstApp.class
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: MyFirstApp.class. Program will exit.
Write main statement as
public static void main (String[] args)
So program is:-
public class MyFirstApp
{
public static void main (String[] args )
{
System.out.println("I rule ");
System.out.println("the world.");
}
}
PS: Then I am not going to install windows.
Last edited by Luke Skywalker; 08-01-09 at 07:51 PM. Reason: Automerged Doublepost
thanks again, finally i got one program working![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)