• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The system couldn't find a suitable main method

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

When I run the following program (through Jcreator), I get the message:
The system couldn't find a suitable main method or htm(l) file in the active project".
If someone has got a few minutes to spend in making me less ignorant, thank you.

import java.util.Scanner;
import static java.lang.System.*;


public class choice{

public static void main(String args[]){
Scanner myScanner=new Scanner(System.in);
out.println("If you want to make your brain to work, write 1");
int inputanswer=myScanner.nextInt();
if (inputanswer==1){
Scanner mysecondScanner=new Scanner(System.in);
out.println("2+2=?");
int answ=mysecondScanner.nextInt();
if (answ==4){
out.println("Right!");
}
else{
out.println("wrong");
}
}
else{
out.println("You're free");
}
}
}
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome!

I'm not sure cause I didn't work with JCreator but I think you should check up your project settings. You might not specify the class wich has main method in it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic