need help finding the problem with my code.anything i try running the code it tells exception in thread main.am useing jdk1.5.0_08.please somebody tell me what is wrong and what to do.thanks for your ever listening hears.
[ October 02, 2006: Message edited by: Gregg Bolinger ]
The message will be "Exception in thread main: something something something.
It's the "something something something" part that tells you what's going on, along with the stack trace that tells you exactly what line of what file the error occurred on. Please don't make people do all this work for you -- at least tell us what the whole error message is, and what line of code the exception happens on!
That means that the JDK can't find the class that you are trying to run. There are a variety of causes for this -
First thing to check is that the classpath contains the path you want. (If you're trying to run a class in the current directory, try "java -classpath . Calculator")
Another thing to look at is if the Calculator class is in a package... in this case you need to go to the directory right above the directory where the package starts and use the full name of the class, including the package. (i.e. if Calculator is in the com.mycompany package, you would go to the directory above the "com" directory and then type "java -classpath . com.mycompany.Calculator")
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
posted 12 years ago
thanks for your help.i can run my code with ease now.