Solved

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

Posted on 2006-07-20
11
516 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
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
Industry Leaders: 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 92

Expert Comment

by:objects
ID: 17145129
0
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomcat administrtor 12 68
servlet example 17 59
Is there a simpler dropbox system? 10 44
Html Table Looping (part 2) 5 35
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

749 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