Results 1 to 2 of 2
  1. #1
    nishant.4545 is offline Member
    Join Date
    Jul 2009
    Rep Power

    Default could not find main class, the program wil exit-- error in jar file

    hello everyone,
    the source code for my program is
    import java.util.*;
    class Sort
    public static void main(String q[])
    long start=System.currentTimeMillis();
    int a[]=new int[100000];
    Random r=new Random();
    for(int i=0;i<a.length;i++)
    for(int i=0; i<a.length-1;i++)
    for(int j=i+1;j<=a.length-1;j++)
    int t=a[j];

    long end=System.currentTimeMillis();


    Then i have created a jar file of this program using following commands in the command prompt:
    echo Main-Class: Sort >manifest.txt
    jar cvfm Sort.jar manifest.txt Sort.class

    This creates the jar file. But when I try to run it by double clicking i get the error 'could not find main class. the program will exit'

    Also when i try to run it in command prompt I get an exception that it could not find the main class.

    What should I do?

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Rep Power

Similar Threads

  1. Replies: 2
    Last Post: 09-22-2011, 09:48 PM
  2. Replies: 6
    Last Post: 05-18-2010, 05:11 PM
  3. [SOLVED] Could not find the main class: error...
    By bobleny in forum New To Java
    Replies: 21
    Last Post: 03-02-2010, 11:53 AM
  4. Could not find the main class, program will exit.
    By aryubi in forum New To Java
    Replies: 39
    Last Post: 02-19-2010, 11:02 AM
  5. Could not find the main class. Program will exit.
    By Carrier in forum New To Java
    Replies: 1
    Last Post: 04-22-2009, 02:27 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