Solved

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

Posted on 2006-07-20
11
506 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum5 challenge 5 84
allswap challenge 6 96
servlet doXXX methods 3 48
How do I remove an object from a 3 23
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
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…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

813 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

17 Experts available now in Live!

Get 1:1 Help Now