Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: creating a jar file

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Location
    kathmandu, nepal
    Posts
    29
    My Mood
    Cheerful
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default creating a jar file

    i have made a game with 5 classes and some images. I used inbuilt feature of eclipse to convert to jar file but t didnt include images and i have paste the images seperately to the jar file folder. Co could someone help me how to make a jar file which includes the images in it?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: creating a jar file

    The jar command comes with the JDK can be used to put resources like images into a jar file. See the doc the the jar file. Java SE 7 Java Archive (JAR)-related APIs & Developer Guides
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Location
    kathmandu, nepal
    Posts
    29
    My Mood
    Cheerful
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: creating a jar file

    i have read this document but couldn't understand properly.....so i have made this post

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: creating a jar file

    Please explain what you didn't understand.

    Did you try the command? What happened?
    Are you on the windows OS? You could write a .bat file to hold the jar file command for repeated use.
    Add a More command at the end to hold the command prompt window open after the jar command executes so you can see any errors and copy them to post here.

    Here is a batch file I use to create a jar file:
    Rem Create the ExtractBoards.jar file:
    @REM
    set JarName=%DEV_HOME%\JavaDevelopment\Misc_Projects\G etHandsFromHTML\ExtractBoards.jar
    %DEV_DRIVE%
    cd %DEV_HOME%\JavaDevelopment\Misc_Projects\GetHandsF romHTML
    D:\Java\jdk1.7.0.7\bin\jar -cmf ExtractBoards.mnf %JarName% *.class
    Echo ----- Created %JarName% -----
    More
    The names in % are environment variables.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. run jar file inside a jar file?
    By ufrubnuckle in forum Java Theory & Questions
    Replies: 1
    Last Post: February 21st, 2013, 06:58 AM
  2. creating runnable JAR file
    By olimpicco in forum Java IDEs
    Replies: 25
    Last Post: January 11th, 2012, 09:15 AM
  3. Creating JAR file in eclipse HELP !
    By Maheshkh in forum Java IDEs
    Replies: 3
    Last Post: September 16th, 2011, 12:37 PM
  4. [SOLVED] jar file Built(clean and build) perfectly, but not running as jar
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 18
    Last Post: July 11th, 2011, 11:41 AM
  5. Problem in Creating Jar file
    By sikriyogesh in forum Member Introductions
    Replies: 0
    Last Post: November 20th, 2009, 02:12 AM