Results 1 to 4 of 4
  1. #1
    Draugnar is offline Member
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Default [Solved] Main Class not found

    Hi, I have a strange issue. Before everything, I'd like to say that my program works well on Linux, but gives me "could not find main class: app.App" error when I run it in the Windows environment. Here's the picture:

    ImageBanana - screenshot_055.png

    On the left, the same jar running on Linux, and on the right is an error message displayed in Windows environment. What could be the problem?
    Last edited by Draugnar; 01-09-2010 at 03:13 AM. Reason: Solved

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Did you specify the main class in the manifest of the jar file then?

  3. #3
    Draugnar is offline Member
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Default

    I'm not sure what you mean, here's my manifest file:

    The program is written and built in netbeans 6.8, by the way.

    Java Code:
    Manifest-Version: 1.0
    
    Ant-Version: Apache Ant 1.7.1
    
    Created-By: 14.2-b01 (Sun Microsystems Inc.)
    
    Main-Class: app.App
    
    Class-Path: lib/appframework-1.0.3.jar lib/swing-worker-1.1.jar
    
    X-COMMENT: Main-Class will be added automatically by build
    Last edited by Draugnar; 01-08-2010 at 09:07 PM.

  4. #4
    Draugnar is offline Member
    Join Date
    Jan 2010
    Posts
    4
    Rep Power
    0

    Default

    I figured out what the problem was. As it states in the README file generated:

    Java Code:
    To distribute this project, zip up the dist folder (including the lib folder)
    and distribute the ZIP file.
    After including the lib folder containing another jar file and a zip, it worked perfectly. :)

Similar Threads

  1. main class not found
    By abhijit in forum Networking
    Replies: 3
    Last Post: 10-01-2009, 09:05 AM
  2. No Class Def Found Error:
    By fithous in forum Java Applets
    Replies: 0
    Last Post: 04-02-2009, 05:30 PM
  3. No main class found error
    By jhering1986 in forum New To Java
    Replies: 17
    Last Post: 03-28-2009, 02:34 AM
  4. Replies: 4
    Last Post: 01-01-2009, 03:58 AM
  5. Replies: 12
    Last Post: 12-05-2008, 05:37 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
  •