Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-05-2009
Member
 
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
Reply With Quote
  #2  
Old 09-05-2009
Member
 
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.
Reply With Quote
  #3  
Old 09-05-2009
Member
 
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
Reply With Quote
  #4  
Old 09-05-2009
Member
 
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to create a .Jar file"
Thread Thread Starter Forum Replies Last Post
Driver error: Cannot create a file when that file already exists Nickason Windows XP Support 1 21-03-2013 03:52 PM
cannot create PDF file Rafferty!!! Windows Software 7 12-11-2011 10:04 PM
Windows 7: Unable to create file with File system error (65535) TheHibiscus Operating Systems 4 23-01-2011 07:07 PM
Windows Backup : Cannot create a file when that file already exists Animorc Operating Systems 3 04-06-2009 09:40 AM
Cannot create a file when that file already exists Agilent Windows XP Support 6 09-09-2008 10:24 AM


All times are GMT +5.5. The time now is 12:50 AM.