java error.............help me!!!!

Discussion in 'JavaScript' started by brarpavi, Oct 24, 2009.

  1. #1
    Exception in thread "main" java.lang.NoSuchMethodError: main this is the error when i run testmain on cmd?
    tell me what should i do?? i have just started to learn java and i get this error when i try to run simple hello world program.It compiles well but gives up error at run time
     
    brarpavi, Oct 24, 2009 IP
  2. Luke Carrier

    Luke Carrier Peon

    Messages:
    19
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This isn't a Java programming forum - it's about the scripting language, 'JavaScript'. The two aren't remotely similar, Java is a cross-platform programming language and JavaScript is a scripting language which allows web pages to be a little more interactive and dynamic. You might want to look for another forum to post your question...?
     
    Luke Carrier, Oct 24, 2009 IP
    NinjaNoodles likes this.
  3. sn3twork

    sn3twork Active Member

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    If you give me your exact code on here I can amend it to work properly.

    However here is some code I wrote to do a simply hello world program

    
    
    public class helloworld 
    {
     
      public static void main()
      {
         System.out.println("Hello World");
      }
    
    }
    
    
    Code (markup):
     
    sn3twork, Oct 26, 2009 IP
  4. sn3twork

    sn3twork Active Member

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    Also you may want to use a development environment like BlueJ it is a simple to use program that allows you to make java programs and run them quite easily!

    http://bluej.org/download/download.html
     
    sn3twork, Oct 26, 2009 IP
  5. Ramesh Kumar Jayaraman

    Ramesh Kumar Jayaraman Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    hi..

    class Sample
     
    Ramesh Kumar Jayaraman, Oct 27, 2009 IP
  6. hollisterb

    hollisterb Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    this is intense
     
    hollisterb, Oct 27, 2009 IP
  7. a1max

    a1max Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    may be it works:-
    save the file as the name of the class in this case "helloworld"
    public class helloworld
    {

    public static void main(String args[])
    {
    System.out.println("Hello World");
    }

    }
     
    a1max, Oct 27, 2009 IP
  8. sn3twork

    sn3twork Active Member

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #8

    technically... its String[] args
     
    sn3twork, Oct 28, 2009 IP