Results 1 to 8 of 8
  1. #1
    Doctor Cactus is offline Member
    Join Date
    Oct 2008
    Posts
    63
    Rep Power
    0

    Default Executable Jar File Creation

    Hi, I am writing a Java application and I need help in creating an executable jar file(.jar) for my application. I have succeeded in creating a jar file using the command prompt by following instructions from other websites, but when I try to run it, It says "Java Virtual Machine Launcher could not find main class". Basically, all my .java and .class files are stored in a folder called 'Java123' . They are all seperate .java files e.g. it is not a project. Could this be a problem?

    Help is greatly appreciated.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    To create a jar file, no need to use *.java files, use *.class files of your project. Can you tell me which command you use to create that jar file on the command prompt?

  3. #3
    racerxadam is offline Member
    Join Date
    Jul 2008
    Posts
    68
    Rep Power
    0

    Default

    my guess is that you haven't specified the Main-Class attribute in the jar's manifest

  4. #4
    Doctor Cactus is offline Member
    Join Date
    Oct 2008
    Posts
    63
    Rep Power
    0

    Default Jar File

    I used the instructions at this website:

    skylit.com/javamethods/faqs/createjar.html

  5. #5
    racerxadam is offline Member
    Join Date
    Jul 2008
    Posts
    68
    Rep Power
    0

    Default

    Sun's Jar Tutorial

    Read the warning under the section "Setting an application's entry point". I created a helloworld application and tried the steps from the link you listed and got the same error. After reading a bit on Sun's site I was able to get it to work correctly. Extract your jar and make sure the manifest has the Main-Class attribute.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Off topic.

    In most of the cases dealing with the Suns' tutorial is the best way to keen on Java. Everything you want is there.

  7. #7
    NettemJAVA is offline Member
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    Default Hi..

    Hi All,

    :)

    I am newly joined in Java forum group.

    :)

    BR// Venkat

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by NettemJAVA View Post
    Hi All,

    :)

    I am newly joined in Java forum group.

    :)

    BR// Venkat
    Welcome!

    Please read our FAQ page before posting again. You've introduce in the wrong sub-forum

Similar Threads

  1. How to print the creation date of a jar file
    By lunarbof in forum Advanced Java
    Replies: 9
    Last Post: 08-22-2008, 06:12 PM
  2. Manifest file in executable jars
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-15-2007, 08:16 PM
  3. Generate an executable file
    By romina in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:30 AM
  4. creation of new function
    By an8086 in forum Advanced Java
    Replies: 1
    Last Post: 07-16-2007, 02:20 PM
  5. An Introduction to Eclipse PDE - File Creation
    By JavaForums in forum Eclipse
    Replies: 0
    Last Post: 05-09-2007, 06:40 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
  •