Solved

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

Posted on 2006-07-20
11
497 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
Comment Utility
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
Comment Utility
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
Comment Utility
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 8

Expert Comment

by:hiteshgupta1
Comment Utility
can u go for another way?
0
 
LVL 8

Expert Comment

by:hiteshgupta1
Comment Utility
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:mayankeagle
mayankeagle earned 100 total points
Comment Utility
>> 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
Comment Utility
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
Comment Utility
0

Featured Post

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.

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.

728 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

14 Experts available now in Live!

Get 1:1 Help Now