Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Java Class from C

Status
Not open for further replies.

NawazKhurshid

Programmer
May 17, 2006
7
DE
I have an editor that is written in C lauguage, it contains many blocks whose computational function are written in C language. For one block I have a computational code written in JAVA. I want to Call Java Function for this. I can use JNI but i m thinking of a different option for which i need your help.

First of All is it possible to execute a command line instruction like dir, ipconfig from C language Program using exec()or any other function.
I am on WINDOWS not on UNIX or linux.

If so, then i can execute javac from C program.

Please Please help me in this regard
 
Use the system() function.
Ex:
Code:
system( "dir" );
 
Thank u so much for ur immediate reply, i wonder if we can like wise call java.exe we can call java function without using JNI.

Thanx again

regards

 
You can invoke a java program from the command line, but you won't have access to a class or method.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top