Results 1 to 2 of 2
  1. #1
    barney is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default ERROR: Exception in thread "main" java.lang.NoSuchMethodError: main

    Hi, I'm having a problem running .java programs in cmd prompt, its compiles ok but when i go to run it, example -->(java prac8prog1)
    it brings up the following error:
    "Exception in thread "main" java.lang.NoSuchMethodError: main"
    Im using a JAR file ( import B102.*; ) at the top of my programs, that I was told to use, could this be whats the causing the error?

    Also I need some help with a different program I have to do, I need to know how to set out a character array for the 26 letters in the alphabet. I'm pretty sure what i started doing below is wrong and i need some advice.

    Java Code:
    class Assignment2prog1
    {
        public static void UserInput()
        {
            public String Data = new String()
            Screen.out.println("Please enter a series of character values from the keyboard: ");
            String.toLowerCase()
            Data=keybd.in.readchar();
            return Data;
        }
    
        public static void Calculate()
        {
        	private char calcArray[] = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
        	private int index;
            //??
            for(index=0; i<?; index++)
        }
    
        public static void Display()
        {
    
        }
    
        public static void Main(string args[])
        {
        	int Input=0
        	
        	Input = UserInput();
        }
    }

    Thanks.

  2. #2
    lenny is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    The name of the entry point function should be main() and not Main().

Similar Threads

  1. Replies: 8
    Last Post: 03-05-2011, 04:53 AM
  2. Replies: 1
    Last Post: 08-06-2007, 07:07 AM
  3. Replies: 2
    Last Post: 08-01-2007, 06:26 AM
  4. Replies: 1
    Last Post: 07-25-2007, 11:55 PM
  5. Replies: 1
    Last Post: 07-16-2007, 07:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •