Problem to compile sample java code in NetBeans

Discussion in 'Java' started by zahid.hstu.java, Sep 16, 2011.

  1. zahid.hstu.java

    zahid.hstu.java New Member

    Joined:
    Sep 16, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I am new bie in java. learning the concepts theoretically. in the mean time i have downloaded sample java project source code in netbeans. But tried to compile my self but not succeed.

    can you please tell me the way how can i do it.

    Here is the code

    named student_record_information

    its showing errors like this

    Code:
    java.lang.NoClassDefFoundError: javaapplication1/Main
    Caused by: java.lang.ClassNotFoundException: javaapplication1.Main
            at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    Could not find the main class: javaapplication1.Main.  Program will exit.
    Exception in thread "main" Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)
     

    Attached Files:

  2. ManzZup

    ManzZup New Member

    Joined:
    May 9, 2009
    Messages:
    278
    Likes Received:
    43
    Trophy Points:
    0
    Occupation:
    Production Manager:Software @ ZONTEK
    Location:
    Sri Lanka
    Home Page:
    http://zontek.zzl.org
    the error says that the program calls to a class Main that is not available or the compiler cannot find it
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice