Results 1 to 6 of 6
  1. #1
    seng83 is offline Member
    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Unhappy JCreator build executable jar file

    Hi All,

    I had finish wrote a java script using JCreator LE. Now i want to build it into executable jar file. I had search a lot info on build a jar file, and follow all the step a mention.
    I still newbie on java so my coding having so redundant code. But it still able to run and output the result i want.
    I had create a manifest.txt with my main class and end with new line. As show below:
    ================================================== =========================
    --------------------Custom Tool: Create Jar File--------------------
    Command : "C:\Program Files\Java\jdk1.6.0_24\bin\jar.exe" cvfm output.jar manifest.txt *.class
    Directory : ""

    added manifest
    adding: JOINFILE$1.class(in = 942) (out= 596)(deflated 36%)
    adding: JOINFILE$2.class(in = 942) (out= 593)(deflated 37%)
    adding: JOINFILE$3.class(in = 653) (out= 444)(deflated 32%)
    adding: JOINFILE$ButtonHandler.class(in = 972) (out= 558)(deflated 42%)
    adding: JOINFILE.class(in = 14232) (out= 6647)(deflated 53%)

    Process completed.
    ================================================== ==============================
    After this run i have a jar file created, but nothing show when i double click it.
    When i run the jar using CMD it prompt:
    ==================================
    Exception in thread "main" java.lang.NoClassDefFoundError: JOINFILE/class
    Caused by: java.lang.ClassNotFoundException: JOINFILE.class
    at java.net.URLClassLoader$1.run(unknow source)
    at java.security.AccessController.doPrivileged(Native Menthod)
    at java.net.URLClassLoader.findClass(unknow Source)
    .......
    Count not find the main class: JOINFILE.class. program will exit.
    ====================================
    But inside the jar file the JOINFILE.class are inside, with correct menifest.mf file.
    I had spend a lot of time writing this script but end up can run it as application.
    I wanted to vomit blood already.
    Any expert pls do help me up.
    You can remote to my notebook if you free.
    My email address is; Chungseng83@yahoo.com

    God bless you all.

    Regards
    Chuo

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

    Default

    Quote Originally Posted by seng83 View Post
    Exception in thread "main" java.lang.NoClassDefFoundError: JOINFILE/class
    Caused by: java.lang.ClassNotFoundException: JOINFILE.class
    Name your class just "JOINFILE", not "JOINFILE.class" on the command line.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    seng83 is offline Member
    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Default

    Hi Jos,

    i dont really get you.

    Exception in thread "main" java.lang.NoClassDefFoundError: JOINFILE/class
    Caused by: java.lang.ClassNotFoundException: JOINFILE.class

    this error message come after i type ( java -jar JOINFILE.jar)
    The jar file are is been created but cannot run.

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

    Default

    Quote Originally Posted by seng83 View Post
    Hi Jos,

    i dont really get you.

    Exception in thread "main" java.lang.NoClassDefFoundError: JOINFILE/class
    Caused by: java.lang.ClassNotFoundException: JOINFILE.class

    this error message come after i type ( java -jar JOINFILE.jar)
    The jar file are is been created but cannot run.
    What is your entry for the MainClass in your manifest? I bet it is this:

    Java Code:
    Main-Class: JOINFILE.class
    That is incorrect; make it:

    Java Code:
    Main-Class: JOINFILE
    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default

    In your menifest did you mention your main class? I think not.
    please edit your menifest.txt.
    There must be:

    Java Code:
    Main-Class: JOINFILE
    Regards
    Ujjal

  6. #6
    seng83 is offline Member
    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Default

    change to Main-Class: JOINFILE on the menifest.txt but still the same.
    Is that underscore is allow on the class name? like: TEST_JOINFILE
    Can you remote to my pc and show me?

Similar Threads

  1. create windows executable using executable jar file
    By sarwar1234 in forum New To Java
    Replies: 2
    Last Post: 02-07-2011, 08:29 PM
  2. Executable jar file
    By franklyn@bellsouth.net in forum New To Java
    Replies: 12
    Last Post: 08-26-2010, 01:03 PM
  3. Executable File.
    By BeeGee in forum Advanced Java
    Replies: 13
    Last Post: 05-25-2010, 12:35 PM
  4. jar file in JCreator
    By jadaleus in forum Advanced Java
    Replies: 2
    Last Post: 10-22-2008, 11:07 PM
  5. Executable Application, use JCreator
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 06:03 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
  •