hi All,
I've just start java have a problem with compiling an Application.
First i done Coding :
And when I've try to compile the App its don't print on console give the Eror you can see here :HTML Code:/* This program Will take two arguments Hello world from the command Prompt and prints them to standard console. If you specify less then two arguments an exception Will be thrown*/ public class TwoArgsApp { public static void main(String args[]){ //Displays the first argument on console System.out.println("First argument"+args[0]); //Displays the second argument on console System.out.println("Second argument"+args[1]); } }
would you like to mention,where i was done mistake ?HTML Code:D:\>set path=C:\Program Files\Java\jdk1.6.0_27\bin D:\>javac TwoArgsApp.java D:\>java TwoArgsApp Exception in thread "main" java.lang.NoClassDefFoundError: TwoArgsApp Caused by: java.lang.ClassNotFoundException: TwoArgsApp at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: TwoArgsApp. Program will exit. D:\>
or is it jdk version problem ?
Thanks in Advance
usman


Reply With Quote
Bookmarks