Solved

how to make executable from my jars?

Posted on 2012-03-20
10
251 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
Comment Utility
make it as single jar and placethe maifest file with in that
0
 

Author Comment

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

Expert Comment

by:ksivananth
Comment Utility
just specify the main-class
0
 

Author Comment

by:pvinodp
Comment Utility
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
Comment Utility
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 166 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>>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
Comment Utility
thanks for your comments
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

A short article about problems I had with the new location API and permissions in Marshmallow
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
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.

772 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

13 Experts available now in Live!

Get 1:1 Help Now