Results 1 to 5 of 5
  1. #1
    yoodidoo is offline Member
    Join Date
    Jul 2009
    Posts
    7
    Rep Power
    0

    Default Need help making .jar

    I just finished my java project i've been working on, and now i'd like to make
    an executable .jar file. However, my project currently runs as a Java Bean.

    I've never exported my projects before, so I don't know much, but I do know
    how to make a .jar with an application, so in my GUI class, named GUIProject, I added:
    Java Code:
    public static void main(String args[]){
          GUIProject test = new GUIProject();
    }
    However, my project no longer opens when I put this. My question is can I make
    an executable .jar with the Java Bean, or is there a better way to make it into
    an application?

  2. #2
    vkorenev is offline Member
    Join Date
    Aug 2009
    Location
    Kharkov, Ukraine
    Posts
    29
    Rep Power
    0

    Default

    You must put
    Main-Class: <your class name with main method>
    line in META-INF/MANIFEST.MF file inside your jar.

  3. #3
    yoodidoo is offline Member
    Join Date
    Jul 2009
    Posts
    7
    Rep Power
    0

    Default

    Where do I find that file exactly? Is it the same as when they ask to "Select
    the class of application entry point" in eclipse's export wizard?

    Also, will doing that fix the problem that my project doesn't open when
    run as a java application?

  4. #4
    vogella is offline Member
    Join Date
    Aug 2009
    Location
    Heidelberg
    Posts
    47
    Rep Power
    0

    Default

    The export process is in detail described here: Eclipse Java IDE - Tutorial

    Try first to run your program from the command line to make sure that the export worked as expected.

    To make the jar automatically running you have to create also the MANIFEST.MF as vkorenev described.

  5. #5
    yoodidoo is offline Member
    Join Date
    Jul 2009
    Posts
    7
    Rep Power
    0

Similar Threads

  1. Replies: 3
    Last Post: 07-15-2009, 07:10 AM
  2. Making a count..
    By Samgetsmoney in forum New To Java
    Replies: 15
    Last Post: 02-18-2009, 02:44 PM
  3. Help making table
    By jls7168 in forum New To Java
    Replies: 2
    Last Post: 01-26-2009, 04:53 PM
  4. Making triangle
    By banie in forum New To Java
    Replies: 4
    Last Post: 02-02-2008, 12:23 PM
  5. Help with making this algorithm better
    By RLRExtra in forum New To Java
    Replies: 6
    Last Post: 01-17-2008, 05:11 PM

Tags for this Thread

Posting Permissions

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