Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

call C program from Java

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Can anyone tell me, How to call C program method from java class.
Please let me, what are the various exception will occur the moment we call.

Thanks in advance
Narasimha
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API to for calling C code is called JNI.

If you just want to start a program, you can do that using the ProcessBuilder class or the Runtime.exec method.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can call a C program from a Java class using the J2EE Connector Architecture API.

http://java.sun.com/j2ee/connector/
 
narasimharao konjeti
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont want J2EE enterprise Connnector architecture.
My simple requirement is : I would like to get some fuctionality, which is there in C program.

Thank in advance.
will appreciate for your replies.

Thanks
Narasimha
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If neither of the suggestions I made are practical (why not?) you'll have a hard time getting this to work.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I dont want J2EE enterprise Connnector architecture.
My simple requirement is : I would like to get some fuctionality, which is there in C program.



Ok. However, you asked a question and I gave you an answer. You can get the functionality of the C program with the JCA API. (See link above more info)

Good luck!
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!