GeekInterview.com
Results 1 to 5 of 5

Run Time Error : "Couldn't find the main class : program Will Exit".

This is a discussion on Run Time Error : "Couldn't find the main class : program Will Exit". within the Java forums, part of the Software Development category; Hi Guys Scenario : After successfully compiling the program and creating ".class" files which includes ".class" for main class - while trying to run the program from "Windows Command Prompt" ...

  1. #1
    star3v is offline Junior Member Array
    Join Date
    Mar 2009
    Answers
    6

    Run Time Error : "Couldn't find the main class : program Will Exit".

    Hi Guys

    Scenario : After successfully compiling the program and creating ".class" files which includes ".class" for main class - while trying to run the program from "Windows Command Prompt" shell getting the message "Couldn't find the main class : program will exit" .
    [ JDK & JRE : 1.6.0_13 Standard Edition ].

    Expecting solution from you geeks ???

    By
    Venky

    Last edited by star3v; 04-11-2009 at 09:39 AM. Reason: Added the source from where the program was given a try to run : (i.e) from "windows cmd"

  2. #2
    bchimulkar is offline Junior Member Array
    Join Date
    Apr 2009
    Answers
    3

    Re: Run Time Error : "Couldn't find the main class : program Will Exit".

    There could be 3 reasons why the program is not running:
    1) Check your classpath first where in the lib folder should contain the exact path of your JDK1.6.0_13/bin folder
    2) Check in which folder you have kept the file and try running the file from there.
    3) check if it has come package name-- if yes then go to the class folder of that particular package and run it from the classes folder.

    I guess it should work.


  3. #3
    star3v is offline Junior Member Array
    Join Date
    Mar 2009
    Answers
    6

    Re: Run Time Error : "Couldn't find the main class : program Will Exit".

    Hi bchimulkar

    I am thankful for your reply and I appreciate it,even though the problem has been fixed way back.

    Details of it given below.

    Before posting the question,I have set environment path for the "\bin" but I wasn't interested to set environment "classpath", since it affects/modifies all other java applications.

    So the solution is running the java application individually using the "-cp & relevant dir path" in windows cmd.

    Which I have done it and the program works fine.

    By
    Venky


  4. #4
    soupstreet is offline Junior Member Array
    Join Date
    Aug 2012
    Answers
    1

    Re: Run Time Error : "Couldn't find the main class : program Will Exit".

    Hi people,
    Please suggest me how to run the Launcher in a step by step procedure; as I'm completely unaware about how to use Java through cmd.
    Please help.
    Thanks


  5. #5
    Murali100 is offline Junior Member Array
    Join Date
    Aug 2012
    Answers
    6

    Re: Run Time Error : "Couldn't find the main class : program Will Exit".

    JVM could not find the main class. In your program you had not written main method


    •    Sponsored Ads