Solved

.exe / jar files - for application distribution

Posted on 2001-06-27
10
259 Views
Last Modified: 2013-11-23
hi lads/lassies,

I'd like to distribute a java app on a virgin machine and want to do as little setup as possible.
I think my two main options are .exe or jar...

What is the story with JAR files and will they save me copying all of my packages information across to the new machine and also save me configuring the classpath etc?

Would an exe be the answer to my prayers?
thanks!
0
Comment
Question by:dubliner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 16

Expert Comment

by:Valeri
ID: 6230744
Yes, .jar is more suitable. It contains all of your packages and s.o. Use it...
Regards,
Valeri Kronin
0
 

Author Comment

by:dubliner
ID: 6230799
How do I use the jar once I have zipped up all my stuff in it?
Do I have to un-jar the class files first into a directory or something?
0
 
LVL 16

Expert Comment

by:Valeri
ID: 6230911
I'm using JBuilder / Deployment Wizard....

To place .jar file is the same to have directory structure of the packages. I think that you can build the zip by this directory using WinZip as well...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:wgilster
ID: 6232203
No just run the classes straight from the .jar.  Make sure the .jar is in your classpath and run the class with the fully qualified package name.

java package1.fred.MyClass

you can specify the classpath on the command line as well if you don't want to modify the environment classpath.
0
 
LVL 1

Expert Comment

by:wgilster
ID: 6232218
specify the classpath by doing this...


java -cp JarfileThatHoldsMyPackage.jar
0
 
LVL 1

Accepted Solution

by:
wgilster earned 150 total points
ID: 6232233
Now putting it all together...

java -cp JarfileThatHoldsMyPackage.jar package1.fred.MyClass

or

java -classpath JarfileThatHoldsMyPackage.jar package1.fred.MyClass


That should do it...

0
 
LVL 1

Expert Comment

by:sumeetsh
ID: 6264232
hi
you could do the following

1> Create a jar file consisting of your application
that could be done using
Syntax
=======
>jar cvmf manifist_filename jar_file name input_files
 
Your app.mf file could consist of following attributes:
=========================================================
Main-Class: main_class_name
Class-Path: swingall.jar classes102.zip
=========================================================
-This would set main class for your jar and classpath for the application
swingll.jar and classes102.zip r in same DIR as your jar file.

2>After Creating JAR file for your application you could
create an installable for you application
3> Nope u dont need to unjar youe files
can invoke your application by :-
>java -jar yourapp.jar

This would invoke your Main Class set in main class attribute of our mannifist file.

Regards
Sumeet




3>






0
 

Author Comment

by:dubliner
ID: 6276212
Thanks for the above but I'm still getting a couple of problems when I run the jar...

I've located another jar file which contains javax.comm stuff and I need to include this too.  How do I do this?
My directory structure is:

d:\work - general working directory
d:\work\packages - general classes and stuff
d:\java\comm - contains the bloody jar file

The class I need to run initially is in the 'work' directory and the stuff to include is in the 'work/packages' and 'java/com' directories.

Thanks!
0
 
LVL 1

Expert Comment

by:sumeetsh
ID: 6276224
hi
For that what u could do is to include the path for othe jar file in the manifist file i told u about lats time
this should work
0
 

Author Comment

by:dubliner
ID: 6337221
Thanks lads!
jamie
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question