Solved

how to make executable from my jars?

Posted on 2012-03-20
10
257 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
 

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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
This is about my first experience with programming Arduino.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now