Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

This is Appalaraju,

I have problem, if any body know the solution please send the answer to my mail and post this site also.

Can you call the below command from c# program and give me the executable file,

command : java -jar sample.jar

My mailId: [removed]@gmail.com
Posted
Updated 10-Nov-11 0:35am
v3
Comments
Menon Santosh 10-Nov-11 6:39am    
have U tried
System.Diagnostics.Process.Start("exe name");
BillWoodruff 10-Nov-11 10:00am    
Double post of previous question.

 
Share this answer
 
Comments
Member 8288629 10-Nov-11 6:51am    
that is not my solution
Rajesh Anuhya 10-Nov-11 7:08am    
@op if this is not your solution, how you accepted it as ANSWER
use this code
C#
ProcessStartInfo startInfo = new ProcessStartInfo();
	startInfo.FileName = "file.EXE";
	startInfo.Arguments = f;
	Process.Start(startInfo);
 
Share this answer
 
v2
i took one submit button and textbox in that i assigned the text is "java -jar sample.jar"(this is small jar file output: Hello),

when calling this jar file in windows c# program, result of the file(Hello) directly(without executing the file) displayed in command prompt. this is done by clicking submit button.

I save jar file in "E:" drive.
 
Share this answer
 
Comments
Rajesh Anuhya 10-Nov-11 7:22am    
when calling this jar file in windows c# program, result of the file(Hello) directly(without executing the file) displayed in command prompt. this is done by clicking submit button.

--- then what is your problem?
Member 8288629 10-Nov-11 7:51am    
i want total program for this problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900