Results 1 to 4 of 4

Thread: How to create a .Jar file

  1. #1
    Join Date
    Apr 2009
    Posts
    37

    How to create a .Jar file

    Hello,

    I have college project in which i have to create a JAR file but i encounter a problem.

    Indeed, I am with eclipse -> export jar file, I choose the main class, it shows that JAR has been created but nothing happens when I launch it.

    How is it that I could target the problem?

    Thank you for your help

  2. #2
    Join Date
    Mar 2008
    Posts
    227

    Re: How to create a .Jar file

    Have you included all required classes to your project list, JARs should include all classes of your project, not only the class containing the main but you need to have the all the classes in that project and to that just follow the steps:

    select all => "Export" => "Jar file"

    Then start your. Jar

    hope this solves your problem.

  3. #3
    Join Date
    Mar 2008
    Posts
    192

    Re: How to create a .Jar file

    The basic format of the command for creating a JAR file is:

    jar cf jar-file input-file(s)

    Following are the options and arguments used in this command:

    1. The c option indicates that you want to create a JAR file.
    2. The f option indicates that you want the output to go to a file rather than to stdout.
    3. jar-file is the name that you want the resulting JAR file to have. You can use any filename for a JAR file. By convention, JAR filenames are given a .jar extension, though this is not required.
    4. The input-file(s) argument is a space-delimited list of one or more files that you want to be placed in your JAR file. The input-file(s) argument can contain the wildcard * symbol. If any of the "input-files" are directories, the contents of those directories are added to the JAR archive recursively.


    For more info please visit the following
    http://java.sun.com/developer/Books/...ics/build.html

  4. #4
    Join Date
    Mar 2008
    Posts
    232

    Re: How to create a .Jar file

    • First, make sure you have installed Java 1.2 or above. This facility is not available in previous versions of Java.
    • Next, create your working java system. In general, you will want to put it into a package. For this example, I created a trivial HelloWorld application that prints out "Hello World" plus the first command line argument, and placed it into the package "psae". Therefore, the HelloWorld files (HelloWorld.class, HelloWorld.java) were located in the directory psae. I tested the system to make sure it worked before going on to the next step.


    Here you will get the complete step by step process for creating JAR file:
    http://csdl.ics.hawaii.edu/~johnson/...jar-files.html

Similar Threads

  1. Replies: 1
    Last Post: 21-03-2013, 03:52 PM
  2. cannot create PDF file
    By Rafferty!!! in forum Windows Software
    Replies: 7
    Last Post: 12-11-2011, 10:04 PM
  3. Windows 7: Unable to create file with File system error (65535)
    By TheHibiscus in forum Operating Systems
    Replies: 4
    Last Post: 23-01-2011, 07:07 PM
  4. Replies: 3
    Last Post: 04-06-2009, 09:40 AM
  5. Cannot create a file when that file already exists
    By Agilent in forum Windows XP Support
    Replies: 6
    Last Post: 09-09-2008, 10:24 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,931,166.65515 seconds with 17 queries