Solved

Execute Jar File from C/C++, very Urgent

Posted on 2006-07-20
11
523 Views
Last Modified: 2007-12-19
I have a Executabale jar file. I dont want to to be run directly. I want to create an exe file using C/C++ where in I can open this jar file. Can you please tell me how to do it??
0
Comment
Question by:sree032397
[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
11 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 100 total points
ID: 17145106
Hi sree

you will have to use JNI in order to do it: http://www.javaworld.com/javaworld/javatips/jw-javatip17.html

Cheers
0
 
LVL 1

Author Comment

by:sree032397
ID: 17145115
Think I am having a sample jar file named san.jar. Can you please write a sample code
0
 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
ID: 17145122
0
Technology Partners: 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 8

Expert Comment

by:hiteshgupta1
ID: 17145133
can u go for another way?
0
 
LVL 8

Expert Comment

by:hiteshgupta1
ID: 17145135
use jar.exe -cvfm <jar filename> <manifestfile> -C <directory and its file to be jared>

manifest file should contain

Main-Class:<user main class>

example
Main-Class:a.b.Hello.class

0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 100 total points
ID: 17145142
>> I want to create an exe file using C/C++ where in I can open this jar file.

You need to ask in the C/ C++ topic-area for writing code through which you can execute a process (like the Runtime.exec () API in Java). Just make sure that JAR files have Java 2 (javaw.exe or whatever) as the default application for opening them and not something like Winzip.
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 100 total points
ID: 17145369
You can maybe (depending on classes used) compile it into an executable using gcj
0
 
LVL 6

Assisted Solution

by:phuocnh
phuocnh earned 100 total points
ID: 17150699
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

695 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