DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Error running Java (http://www.daniweb.com/forums/thread73998.html)

staneja Apr 2nd, 2007 12:55 am
Error running Java
 
I was executing a simple core java application using JDK1.5

I wrote code and complied using javac it gave some errors that i fixed and at last it got complied successfully But when i tried to exeute it using java it gave me an error message

Error in thread main.NoSuchMethodFound error:main

Ok now i wanna know why i got this error message , i tried to place the java file in Bin folder and eecute it from there but it didnt worked out.


Can anybody explain me waht to do in such case and how to egt rid of this problem

Cerberus Apr 2nd, 2007 12:08 pm
Re: Error running Java
 
The error is saying that it can't find the 'main' method.

Did you try to run the '.Java' file?

try to run it without the extension

E.g.

java HelloWorld

instead of

java HelloWorld.java

masijade Apr 2nd, 2007 4:01 pm
Re: Error running Java
 
First of all, never place anyting into the "bin" directory of jdk (or really in any directory of the jdk/jre).

Second of all, does your class contain the following method defintion:
public static void main(String[] args) {
  // your code here
}
and I mean that exact method definition? Bcause the error you listed, says it does not.

staneja Apr 3rd, 2007 1:59 am
Re: Error running Java
 
Well I would like to say thanks

I was getting this error because i forgot to put array brackets after args

I mean instead of String args[] i had written String args

so the problem is solved now

vinod_javas Apr 3rd, 2007 2:19 am
Re: Error running Java
 
Staneja if your problem gets solved means just mark it as solved.

staneja Apr 5th, 2007 2:16 am
Re: Error running Java
 
Can you please tell me how to mark it solved.

I didnt find any option to do so

vinod_javas Apr 5th, 2007 2:26 am
Re: Error running Java
 
Mark as Solved | Show Printable Version | Email this Page | Unsubscribe from this Thread


can You see this ... just see above ur first post
and click that link Mark as Solved

ok


All times are GMT -4. The time now is 11:18 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC