3 Replies Latest reply: May 8, 2010 11:06 AM by 793415 RSS

    COULD NOT FIND THE MAIN CLASS PROGRAM WILL EXIT!

    843804
      Hello Guys am a new to the forum and happy to be a member. Please i have problem with my .jar file. After building my projecct i went to open the jar on the dist folder in Netbeans but i receive this error COULD NOT FIND THE MAIN CLASS PROGRAM WILL EXIT! please guys how do i correct this error. Thanks for concern
        • 1. Re: COULD NOT FIND THE MAIN CLASS PROGRAM WILL EXIT!
          843804
          Not sure if you have already found an answer. To make a jar file execute, you need a manifest file within. Do you know if Netbeans has generated a manifest file automatically for you? You can check if you jar file has a manifest file by opening your jar with winzip or winrar and examine the manifest file for a line
          Main-Class: <your main class with package name>
          If it is not there, create one and add it to the jar.

          hope this helps...

          Edited by: Sethu.R on May 2, 2010 3:33 AM
          • 2. Re: COULD NOT FIND THE MAIN CLASS PROGRAM WILL EXIT!
            843804
            Hello thanks for the reply i did what you told me but it did not work please any other advice. Thanks
            • 3. Re: COULD NOT FIND THE MAIN CLASS PROGRAM WILL EXIT!
              793415
              Mikado007 wrote:
              ..did what you told me but it did not work ..
              1) What did not work?
              - Open the Jar in WinZip
              - Find the manifest file
              - Create a manifest file
              - Add a manifest file to the Jar

              Nobody who is not in front of your computer can guess which one of those things "did not work". To get help, you need to be a lot more specific about what did not work.

              2) What was the exact (copy/paste) output you got from the part that did not work?