Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

.exe / jar files - for application distribution

Posted on 2001-06-27
10
Medium Priority
?
280 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 450 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

Industry Leaders: 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!

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.
Suggested Courses

604 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