-2

Possible Duplicate:
How to make executable program in java?

I would like to know how I can open my GUI program without going through the terminal? It being independent, and simply having to click on an icon and it open it.

Community
  • 1
  • 1
John
  • 277
  • 3
  • 13
  • 1
    Duplicate, please see http://stackoverflow.com/questions/4093763/how-to-make-executable-program-in-java, http://stackoverflow.com/questions/6148111/java-executable-jar-creation, http://stackoverflow.com/questions/5083586/java-executable-jar-files – Garrett Hall Feb 08 '12 at 20:31

2 Answers2

3

You need to build a jar file, you can do this with the following command

jar cf jar-file input-file(s)

The options and arguments used in this command are:

The c option indicates that you want to create a JAR file.

The f option indicates that you want the output to go to a file rather than to stdout.

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.

The input-file(s) argument is a space-separated list of one or more files that you want to include 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.

http://docs.oracle.com/javase/tutorial/deployment/jar/build.html

garyamorris
  • 2,587
  • 2
  • 17
  • 23
0

I think you're looking for a jar file. See the Creating a JAR file Java tutorial.

Mat
  • 202,337
  • 40
  • 393
  • 406
rtheunissen
  • 7,347
  • 5
  • 34
  • 65