Results 1 to 7 of 7
  1. #1
    deathnote202 is offline Member
    Join Date
    Apr 2010
    Posts
    8
    Rep Power
    0

    Default could not find main class?

    When I try to open a .jar file it says "could not find main class, the program will exit" why is it doing this and how can i fix it?

  2. #2
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    10

    Default

    I'm guessing you packed the jar yourself. Take a look at what the MANIFEST.MF file does.
    Ever seen a dog chase its tail? Now that's an infinite loop.

  3. #3
    deathnote202 is offline Member
    Join Date
    Apr 2010
    Posts
    8
    Rep Power
    0

    Default

    no i didn't pack it myself and take a look at the what?

  4. #4
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    10

    Default

    If you want your jar file to be executable, it needs to have a MANIFEST.MF file inside, that tells it where the main class is located. It's all in the Sun Java tutorials.
    Ever seen a dog chase its tail? Now that's an infinite loop.

  5. #5
    deathnote202 is offline Member
    Join Date
    Apr 2010
    Posts
    8
    Rep Power
    0

    Default

    well one of my friends sent this to me and there is nothing like that

  6. #6
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    10

    Default

    Ok, then direct your friend to the tutorial on making jar files. I know from personal experience how confusing packing your program into a jar can be at first.
    Ever seen a dog chase its tail? Now that's an infinite loop.

  7. #7
    deathnote202 is offline Member
    Join Date
    Apr 2010
    Posts
    8
    Rep Power
    0

    Default

    well he sent the same thing to one of my other friends and they have no problem with the program


    EDIT: nvm, i just updated my java and now i can open it
    Last edited by deathnote202; 05-10-2010 at 10:10 PM.

Similar Threads

  1. Could not find the main class. Program will exit.
    By XSROSSITER in forum New To Java
    Replies: 0
    Last Post: 01-30-2010, 05:17 AM
  2. Could not find main class
    By Andyj in forum New To Java
    Replies: 2
    Last Post: 10-06-2009, 01:47 AM
  3. Cannot find Main class in Linux OS
    By msskiran in forum Eclipse
    Replies: 0
    Last Post: 04-10-2009, 03:04 AM
  4. Could not find main class - JDK 1.6
    By Syranno in forum New To Java
    Replies: 1
    Last Post: 07-25-2008, 05:07 PM
  5. JVM Could not find main class
    By banduskank in forum Advanced Java
    Replies: 2
    Last Post: 06-24-2008, 09:05 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
  •