• Register
0 votes
307 views

Problem :

In my code have main method in it. The program compiles on jgrasp with no errors but it keeps giving me a message as bellow:
"no main methods, applets, or Midlets found in file jgrasp"
6 5 3
6,930 points

1 Answer

0 votes

Solution :


The java program needs the specific main() method defined in the class that is passed to it. If the commandline is:
java TheClass then TheClass class must have the main() method.
The main() method in your code is NOT the one required by java. 

Syntax for main method in Java :

public static void main(String[] args)

{

}

This main method is called whenever a java program is started. The only exception is in applets, where they're not calling "main" but "init".

9 7 4
38,600 points

Related questions

0 votes
2 answers 108 views
108 views
Problem : I got bellow message from my code Exception in thread "main" java.lang.ArithmeticException: / by zero
asked Nov 1, 2019 peterlaw 6.9k points
0 votes
1 answer 5 views
0 votes
1 answer 5 views
5 views
Problem:hello, kodlogs audience I need your help as I am trying to access a file in java and I don't know how I would be able to that. Kindly help me it would great if you could explain with the help of code
asked Oct 12 anonymous
1 vote
1 answer 54 views
54 views
Problem: Hello Kodlogs, I just joined this forum. I found you people knowledgeable and friendly alongside. Well, I am a new python developer. Well, it could be exaggerative if I address me as a developer, I am a new student perhaps. I have to learn a lot ... The above open command producing an error of filenotfounderror: [errno 2] no such file or directory: But why? Could you identify the problem?
asked Jun 29 adamSw 11.3k points
0 votes
1 answer 4 views
4 views asked 5 days ago SapperIt 1.2k points