When i am running this program in my system , it compile fine but on run it gives following errors .I am not able to run this file.While it successfully run in NetBeans i am using in my system.I am not getting what is reason for this.Please help me.In fact i have installed this many times but it worthless.Here i am showing console output below.This is Simple Hello World Example.
Exception in thread "main" java.lang.NoClassDefFoundError: Hello
Caused by: java.lang.ClassNotFoundException: Hello
at java.security.AccessController.doPrivileged(Native Method)
Could not find the main class: Hello. Program will exit.
Please avoid coloured text; I have changed it to black because many people can’t read red.
That isn’t a path problem at all. Please verify that the Hello.java and Hello.class files are in your current directory, with the dir command. If the files are in your current directory, read on.
What have you done with your classpath? Have you set a system classpath? That usually does more harm than good, and is a common cause of your problem. If you have set your own system classpath, delete it. All of it.
If you didn’t set a classpath, add .; dot‑semicolon at the beginning of your classpath.
Amit K Srivastava
Joined: May 31, 2012
thank you so much Sir Campbell Ritchie:
It works !.
I had set Apache Tomcat Path as classpath in both user and system varaible , that was creating problem.And in future i want put any query in colors as you mentioned.
Thank You So Much.