Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Make and execute .jar-file

Reply
Thread Tools

Make and execute .jar-file

 
 
Java
Guest
Posts: n/a
 
      04-20-2005
Hello,

I have developed an application - and want to distribute it in a jar-file.
But I have face some problems create and executing the jar-file.

The application is split up in four different package, but the main-method i
in the root of these package. Additional i do also have som archives which I
include in the classpath when i compile the project. (Axis.jar,mail.jar,
activation.jar etc)

How du I create the jar-fil, and what should I put in the MANIFEST.MF, and
what about the jar-archives?

The user of the application has a configuration file. When the user change
something in the setup the changes are written to the configurationfil. Can
the user stille edit the configurationfile - if it is put in the
jar-archive?

Thanks,

Btian


 
Reply With Quote
 
 
 
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      04-20-2005
Java wrote:

> How du I create the jar-fil,


http://java.sun.com/j2se/1.5.0/docs/...ndows/jar.html

> and what should I put in the MANIFEST.MF,


http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html

> and
> what about the jar-archives?


Keep them separate. For convenience, you might want to wrap all jars in
some installer, or use JavaWebStart for deployment.

It is in general possible, but not a great idea, to unpack them, repack
them as part of your own jar, and only deliver your own big-fat jar.

> The user of the application has a configuration file. When the user change
> something in the setup the changes are written to the configurationfil. Can
> the user stille edit the configurationfile - if it is put in the
> jar-archive?


Only with great difficulty: Each write would require to unpack the whole
jar in some temporary directory, replace that one file and repack the
jar - assuming the user has write permission to the jar, which is not a
good idea for a centrally installed application.

User config files belong into or below the user's home directory (there
is a system property for getting a user's home directory - if there is
one). On Unix the properties file would typically be a hidden dot-rc
file of the name ".<your-application-name>rc". If you don't want to mess
with files, consider the resources API.

Global application specific (not user specific) config files belong in
some location which is shared the same way like the location in which
the jar is installed. E.g. if the jar resides on some file server, the
global application specific config file should best be shared the same way.

System specific config files (config data overriding global application
specific config data on a per-host level) should go into some
host-specific configuration location. E.g. on Unix this is often the
/etc directory.

/Thomas

--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
 
Reply With Quote
 
 
 
 
Brian
Guest
Posts: n/a
 
      04-20-2005
Hello again,

Yes - i have tried to read those - and I now make a -Jar archive and tries
to execute but, et seems like i can findes the files ind the achive. When I
look in the achive all the files are there - but the JVM can find either the
jar-files from the Class-Path og the .class-files. Is there somthing wrong
with mig MANIFEST:MF?

MANIFEST:MF:
Manifest-Version: 1.0
Main-Class: CVR
Class-Path: poi-2.5.1-final-20040804.jar
poi-contrib-2.5.1-final-20040804.jar poi-scratchpad-2.5.1-final-20040804.jar

Name: CVR/Conf/Config.class

Name: CVR/IO/Filehandler$JavaFilter.class

Name: CVR/IO/Firm.class

Name: CVR/IO/Save.class

Name: CVR/IO/Filehandler.class

Name: CVR/IO/Load.class

Name: CVR/IO/Sheet.class

Name: CVR/Events/About.class

Name: CVR/Events/Exit.class

Name: CVR/Events/MsgBox.class

Name: CVR/Events/Printpage$Document.class

Name: CVR/Events/Printpage.class

Name: CVR/Events/CertificateReader.class

Name: CVR/Events/Help.class

Name: CVR/Events/Printpage$1.class

Name: CVR/Events/Printpage$IntroPage.class

Name: CVR/Events/Update.class

Name: CVR/Lang/Danish.class

Name: CVR/Lang/Language.class

Name: CVR/Lang/English.class

Name: Frame1.class

Name: CVRFrame$2.class

Name: CVRFrame.class

Name: Frame1$ActionListenerHandler.class

Name: Frame1$MouseListenerHandler.class

Name: CVRFrame$1.class

Name: CVR.class


 
Reply With Quote
 
Finn Jensen
Guest
Posts: n/a
 
      04-25-2005
Hello,

My mistake I was trying til include af jar-file in af jar-file.

When I keep it simple it works

Is it possible to jo have at jar-file in a jar-file and use it as if is was
placed outside?

Brian


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make all assertions in a unit test execute jimgardener Python 3 10-16-2010 11:44 PM
Can web "page refresh" make the sql statemens execute? JB ASP .Net 3 04-27-2010 10:22 AM
cygwin make does not execute command under XP Michael C Programming 3 12-07-2005 02:02 PM
How to make Thread Group execute a cycle every 5 minutes goykhmanster@gmail.com Java 1 11-29-2005 10:02 AM
Can i execute aspx file in my asp pag with server.execute method(sorry) Savas Ates ASP General 1 08-17-2004 04:52 PM



Advertisments