Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 549
  • Last Modified:

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

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
sree032397
Asked:
sree032397
5 Solutions
 
girionisCommented:
Hi sree

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

Cheers
0
 
sree032397Author Commented:
Think I am having a sample jar file named san.jar. Can you please write a sample code
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
hiteshgupta1Commented:
can u go for another way?
0
 
hiteshgupta1Commented:
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
 
Mayank SAssociate Director - Product EngineeringCommented:
>> 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
 
CEHJCommented:
You can maybe (depending on classes used) compile it into an executable using gcj
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now