asfensmall.blogg.se

How to make a bluej program executable
How to make a bluej program executable








  1. #How to make a bluej program executable zip file#
  2. #How to make a bluej program executable download#

Jar xf binks.jar Foo.java Executing an executable jar fileĪn executable jar file can be invoked in two ways: from the command line or from a GUI by double cliking it.Īt the DOS or UNIX command prompt, type java -jar myResult.jar. To see the files stored in binks.jar, use the commandĪnd to extract the file Foo.jav a use the command Given a jar file you can view its directory and extract files using the jar command. Where myResult.jar is the jar file you are trying to create, myManifest is the file you created in step 2, and everything else is the files you want to include.

how to make a bluej program executable

Jar cvfm myResult.jar myManifest *.java *.class From the command line, execute the command:.Where MyMainClass is the name of the class containing the main method you want to use. Using a text editor, create a file (say, myManifest) containing the following lines:.class files (and anything else you want to include) together in a single directory. In the next dialog window, choose a directory to put your jar file in, type a name for it where asks for a File Name: (the name should end in.Make sure include source is checked (necessary for grading purposes).For the main class:, choose the class in your program that has the main method you want the program to start from (remember, any class may have a main method, so BlueJ doesn't know which one you want).Open your project in BlueJ, and make sure it runs correctly.

#How to make a bluej program executable download#

However, you can put all the pieces of an applet into a single jar file, and a browser can download and use this file directly, which is much faster. If an applet requires several classes, and maybe a picture or two, your computer has to ask for each part separately. Jar files are especially useful for applets. Jar files can be created from the command line via the jar command or via most Java IDEs, including BlueJ.

how to make a bluej program executable how to make a bluej program executable

In addition to extracing and uncompressing the files for examination, you can also load a jar file into the jvm and even execute a jar file, if you've configured it correctly.

#How to make a bluej program executable zip file#

A Java jar ( Java ARchive) file is like a zip file or a tar file: it holds any number of compressed files. The Java jar ( Java ARchive) file mechanism is a good way of packaging up Java classes for storage and execution.










How to make a bluej program executable