Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #18729

Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs)

Received by 10.224.220.12 with SMTP id hw12mr1010204qab.8.1347517733727; Wed, 12 Sep 2012 23:28:53 -0700 (PDT)
Received by 10.236.142.211 with SMTP id i59mr58297yhj.1.1347517733697; Wed, 12 Sep 2012 23:28:53 -0700 (PDT)
Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!v8no2176002qap.0!news-out.google.com!da15ni3445qab.0!nntp.google.com!v8no2175999qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Wed, 12 Sep 2012 23:28:53 -0700 (PDT)
In-Reply-To <50512cc6$0$293$14726298@news.sunsite.dk>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=173.71.154.51; posting-account=r24XpwkAAABfAJg5TJRsTScS4AL5MjOT
NNTP-Posting-Host 173.71.154.51
References <08dcc4bb-ac13-4992-b576-1d4f51a28d2e@googlegroups.com> <aauhg0F26rkU1@mid.individual.net> <a678337b-f349-4648-8ac6-3b854de9545c@googlegroups.com> <83333a34-5a38-4199-a83b-db2c2c39658b@googlegroups.com> <c2b23e07-fdba-4b91-850a-1c2d104b59db@googlegroups.com> <734d3450-00d4-45cf-a760-f78a10613945@googlegroups.com> <k2nom9$gap$1@dont-email.me> <84caa856-f49b-4ae3-8ae8-e7c5b6579b11@googlegroups.com> <k2o4d5$1rv$1@dont-email.me> <bbccb919-e3d8-48bd-881c-9d5c5d0767d3@googlegroups.com> <b9686186-51c7-4dcc-8e58-7604dc26ce76@googlegroups.com> <k2q9a8$m2g$1@dont-email.me> <784b7374-dd6e-4a35-9f71-07e38e63a972@googlegroups.com> <50512cc6$0$293$14726298@news.sunsite.dk>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <d8124919-8c6a-4454-8d19-bf1f8e26fa2f@googlegroups.com> (permalink)
Subject Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs)
From clusardi2k@aol.com
Injection-Date Thu, 13 Sep 2012 06:28:53 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Received-Bytes 4396
Xref csiph.com comp.lang.java.programmer:18729

Show key headers only | View raw


(1) Research:

Here are notes from books. Obviously, the solution to this problem involves simply looking-up "manifest files" on the Internet.

(1) The manifest.txt (or dot mf) file:

Main-Class: ClassName

Where the ClassName is the fully qualified name of the class that contains the main method that is executed to start the application. It isn't required, but it's typical to use the extension.mf for manifest files.

For example, suppose you have an application whose main class is GuessingGame, and all the class files for the application are in the package com.lowewriter.game. First, create a manifest file named game.mf in the com\lowewriter\game directory. This file contains the following line:

Main-Class: com.lowewriter.game.GussingGame

Then, run the jar command with the options cfm, the name of the archive to create, the name of the manifest file, and the path for the class files. For example:

jar cfm game.jar com\lowewriter\game\game.mf com\loweweriter\game\*.class

Now, you can run the application directly from a command prompt by using the java comand with the -jar switch and the name of the archive file. For example:

java -jar game.jar

This command starts the JRE and executes the main method of the class specified by the manifest file in the game.jar archive file.

If your operating system is configured properly, you can also run the application by double-clicking an icon for the jar file.

(2) You can add images to a Manifest file if you want.

(3) Complex manifests can have many more entries. The manifest entries are grouped into sections. The first section in the manifest is called the main section. It applies to the whole JAR file. Subsequent entries can specify properties of named entities such as individual files, packages, or URLs. Those entries must begin with a Name entry. Sections are separated by blank lines. For example,

Manifest-Version: 1.0
lines describing this archive

Name: Woozle.class
lines describing this file

Name: com/mycompany/mypkg/
lines describing this package

To edit the manifest, place the lines that you want to add to the manifest into a text file. Then run

jar cfm JARFileName ManifestFileName ...

For example, to make a new JAR file with a manifest, run:

jar cmf MyArchive.jar manifest.mf com/mycompany/mpkg/*.class

To add items to the manifest of an existing JAR file, place the additions into a text file and use a command such as

jar ufm MyArchive.jar manifest-additions.mf

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-07 05:15 -0700
  Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-09-07 12:24 +0000
    Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) "John B. Matthews" <nospam@nospam.invalid> - 2012-09-07 09:54 -0400
    Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-13 06:40 -0700
      Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-09-13 17:20 +0000
        Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-13 11:00 -0700
        Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Gene Wirchenko <genew@ocis.net> - 2012-09-13 15:36 -0700
      Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Arne Vajhøj <arne@vajhoej.dk> - 2012-09-13 20:34 -0400
  Re: How Do I Publish My Working Project (corresponding dot jar doesn't   work on other's PCs) Nigel Wade <nmw@ion.le.ac.uk> - 2012-09-07 16:17 +0100
    Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Lew <lewbloch@gmail.com> - 2012-09-07 11:11 -0700
      Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) "John B. Matthews" <nospam@nospam.invalid> - 2012-09-07 21:28 -0400
      Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-10 23:29 -0700
        Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Lew <lewbloch@gmail.com> - 2012-09-10 23:49 -0700
          Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-11 05:12 -0700
            Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) markspace <-@.> - 2012-09-11 09:25 -0700
              Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Lew <lewbloch@gmail.com> - 2012-09-11 11:08 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) markspace <-@.> - 2012-09-11 12:45 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 07:24 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 08:00 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) markspace <-@.> - 2012-09-12 08:21 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 08:58 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 09:02 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) markspace <-@.> - 2012-09-12 09:15 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 09:44 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 10:24 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Lew <lewbloch@gmail.com> - 2012-09-12 10:19 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 11:10 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 11:26 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 11:47 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Lew <lewbloch@gmail.com> - 2012-09-12 12:56 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Lew <lewbloch@gmail.com> - 2012-09-12 12:58 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 20:45 -0400
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-12 23:28 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Arne Vajhøj <arne@vajhoej.dk> - 2012-09-12 20:43 -0400
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't   work on other's PCs) Nigel Wade <nmw@ion.le.ac.uk> - 2012-09-17 10:10 +0100
              Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) clusardi2k@aol.com - 2012-09-11 16:21 -0700
                Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) markspace <-@.> - 2012-09-11 17:33 -0700
  Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) Roedy Green <see_website@mindprod.com.invalid> - 2012-09-07 22:26 -0700

csiph-web