Solved

how to make executable from my jars?

Posted on 2012-03-20
10
265 Views
Last Modified: 2012-04-11
I have a 3 jars.
1. my.jar{ contains the main.class, manifest.mf }
   manifest.mf contains  class-Path: one.jar two.jar
2. one.jar
3. two.jar

To execute manually I have to do "java -jar my.jar"....
It works as all the 3 jars are co-located...
Is there any better way to package this.. so that a customer exeutes just one command and this is done. I dont want to give him a tar file which he has to un-tar to folder and then execut eth command. I know I can place this command in  shell script, but then I need better way than this.

I cannot install any third party software .. I am using redhat 5..
0
Comment
Question by:pvinodp
  • 4
  • 4
  • 2
10 Comments
 
LVL 26

Assisted Solution

by:ksivananth
ksivananth earned 334 total points
ID: 37741641
make it as single jar and placethe maifest file with in that
0
 

Author Comment

by:pvinodp
ID: 37741690
then what is the content of the manifest for the final jar?
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 37741704
just specify the main-class
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:pvinodp
ID: 37741769
the main class will be inside the my.jar...
then how?
The content of present manfest.mf inside my.jar

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 1.5.0_11-b03 (Sun Microsystems Inc.)
Main-Class: com.ejbClient.omcrPing.OmcrPing
Class-Path: jbossall-client.jar omcrEjbClient.jar
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 37741792
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 166 total points
ID: 37742286
make it as single jar and placethe maifest file with in that

You can only do that with special 'one jar' software. The only way around that is first to UNjar everything and make a single jar from all classes
0
 

Author Comment

by:pvinodp
ID: 37760062
Is it possible to pack the jars into a single file which is executable?
And it should be supported by redhat by default. I cannot install any new or third party packages.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 37760406
Is it possible to pack the jars into a single file which is executable?

Yes, do what i said above and set the Main-Class in the manifest
0
 
LVL 26

Accepted Solution

by:
ksivananth earned 334 total points
ID: 37769898
>>The only way around that is first to UNjar everything and make a single jar from all classes

if this is the only way, isn't this I told in #37741641? ;)
0
 

Author Closing Comment

by:pvinodp
ID: 37836075
thanks for your comments
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports Licensing Questions 4 34
expand ext4 on centos 6 5 37
PHP website on Linux - server DNS address could not be found. 18 48
Create .bat File 16 34
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

838 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