?
Solved

.exe / jar files - for application distribution

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

777 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