Error running Java

Thread Solved
Reply

Join Date: Dec 2006
Posts: 56
Reputation: staneja is an unknown quantity at this point 
Solved Threads: 1
staneja's Avatar
staneja staneja is offline Offline
Junior Poster in Training

Error running Java

 
0
  #1
Apr 2nd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 162
Reputation: Cerberus is an unknown quantity at this point 
Solved Threads: 14
Cerberus Cerberus is offline Offline
Junior Poster

Re: Error running Java

 
0
  #2
Apr 2nd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,285
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 243
masijade's Avatar
masijade masijade is online now Online
Nearly a Posting Maven

Re: Error running Java

 
0
  #3
Apr 2nd, 2007
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:
  1. public static void main(String[] args) {
  2. // your code here
  3. }
and I mean that exact method definition? Bcause the error you listed, says it does not.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 56
Reputation: staneja is an unknown quantity at this point 
Solved Threads: 1
staneja's Avatar
staneja staneja is offline Offline
Junior Poster in Training

Re: Error running Java

 
0
  #4
Apr 3rd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: Error running Java

 
0
  #5
Apr 3rd, 2007
Staneja if your problem gets solved means just mark it as solved.
Adios,

Vinod......
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 56
Reputation: staneja is an unknown quantity at this point 
Solved Threads: 1
staneja's Avatar
staneja staneja is offline Offline
Junior Poster in Training

Re: Error running Java

 
0
  #6
Apr 5th, 2007
Can you please tell me how to mark it solved.

I didnt find any option to do so
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: Error running Java

 
0
  #7
Apr 5th, 2007
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
Adios,

Vinod......
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC