Results 1 to 6 of 6
  1. #1
    liran is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

    Default Can not make a runnable jar of my project

    * At other projects it's working.

    I try to do in eclipse: export -> java -> Runnable Jar... but it tells me:
    could not find main method...

    but in my main class I defined it it has:
    public static void main(String[] args)

    (the file is created, but when i double click it - java exception...)

    Maybe this will help to:


    * I use a lot of jars in my project, which exist in the same folder of the project and added to build path, and also I manually added user libraries.

    I would really appreciate help with a solution.
    thanks

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Does your manifest file contain the main class information?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    liran is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

    Default

    The eclipse should do this for me, and no, it does not. Actually, the action of the jar making is not finished. When I open the jar file that created, the mainfest in it is pretty much empty and without a main-class definition. But even when I edit it and add the main class line, it has a java error when i click it.

    I made a runnable jar to this project about 1-2 month ago, and the mainfest file was long, and the mainfest folder contained a lot of things, maybe beacuse it's an Apache Tomact Project ? or has a lot of jars ? I don't know, i need to start it regulary...

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,728
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by liran View Post
    The eclipse should do this for me
    What if there's more than one class with a main( ... ) method? Should Eclipse search them all and present you the options? You are responsible for a manifest in your .jar file and Eclipse even helps you with that.

    kind regards,

    Jos

  5. #5
    liran is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

    Default

    Offcourse, when i make the jar, i choose the class with the main method.

  6. #6
    liran is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

    Default [solved]

    The solution:
    eclipse - project properties - java build path - order and export - select all.

Similar Threads

  1. Thread RUNNABLE or WAITING
    By Pushkar in forum Threads and Synchronization
    Replies: 10
    Last Post: 01-14-2010, 02:36 AM
  2. How to make a runnable jar with necessary libraries
    By Atriamax in forum New To Java
    Replies: 2
    Last Post: 10-27-2009, 11:36 PM
  3. Java: Make runnable java-file
    By MrBambey in forum New To Java
    Replies: 4
    Last Post: 08-10-2009, 07:40 AM
  4. what is SwingUtilities.invokeLater(new Runnable())
    By sivakumar_sakam in forum AWT / Swing
    Replies: 3
    Last Post: 05-06-2009, 05:47 AM
  5. Replies: 0
    Last Post: 04-25-2009, 11:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •