943,989 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 1335
  • Java RSS
Apr 2nd, 2007
0

Error running Java

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
staneja is offline Offline
63 posts
since Dec 2006
Apr 2nd, 2007
0

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
Reputation Points: 27
Solved Threads: 14
Junior Poster
Cerberus is offline Offline
162 posts
since Sep 2006
Apr 2nd, 2007
0

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:
Java Syntax (Toggle Plain Text)
  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.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Apr 3rd, 2007
0

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
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
staneja is offline Offline
63 posts
since Dec 2006
Apr 3rd, 2007
0

Re: Error running Java

Staneja if your problem gets solved means just mark it as solved.
Reputation Points: 119
Solved Threads: 7
Practically a Posting Shark
vinod_javas is offline Offline
871 posts
since Feb 2007
Apr 5th, 2007
0

Re: Error running Java

Can you please tell me how to mark it solved.

I didnt find any option to do so
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
staneja is offline Offline
63 posts
since Dec 2006
Apr 5th, 2007
0

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
Reputation Points: 119
Solved Threads: 7
Practically a Posting Shark
vinod_javas is offline Offline
871 posts
since Feb 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Error in NetBeans
Next Thread in Java Forum Timeline: Putting files in Jlist





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC