Hello I have not used Java on linux except running java programs there... but on Windows you use javac to compile the programs and java to run them? Isn't it the same at linux?
Then you should do: javac Example.java and then java Example to run it Sorry if I am misleading you -Halli 2009/9/9 SATISH CHANDRA <[email protected]> > > Hello, > > *Will anyone please help me in compiling java program. > *I am using Mandriva linux operating system. > *I have written a simple java program: > // This is a simple Java Program. > > class Example > { > public static void main( String arg[]) > { > System.out.println("This is a simple java program."); > } > } > > *I have saved this program as Example.java > *I am trying to compile this program at $ prompt as > $ java Example.java > I AM GETTING ON SCREEN AS : > Exception in thread "main" java.lang.NoClassDefFoundError: Example/ > java > Caused by: java.lang.ClassNotFoundException: Example.java > at java.net.URLClassLoader$1.run(URLClassLoader.java:220) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:208) > 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) > Error: Could not find the main class. > Error: A JNI error has occurred, please check your installation and > try again > > PLEASE HELP ME OUT. > > Satish Chandra > [email protected] > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
