LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-16-2003, 03:08 PM   #1
renato soffiatt
LQ Newbie
 
Registered: Oct 2003
Posts: 1

Rep: Reputation: 0
Question What is the best way to call a Java program from a C prog in Linux?


I have a C program running in a Linux and I need to call a Java program (use a Java Interface).

Someone told me to use the system call EXEC to call the java program. But how to use it passing all the necessary parameters and also receiving the result of the operation?

Is there a way to create something like a proxy in C for a Java Interface, so that I can use the java object as it was "inside" my C program?

I am not familiar with Linux yet. I would apreciate any help.
If it possible, please, give code examples!

Very thanks
Renato
 
Old 10-17-2003, 07:06 AM   #2
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 32
One approach is to use

"system (java filename)"

and then using stdin & stdout to comm. between the two apps. I have done this and it is good. This method is also found in "Thinking in java" from www.mindview.net.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
call mail program like blat from java to send attachments naijaguy Linux - Software 1 05-04-2008 09:09 PM
how to write a simple c prog to call a script RajRed Programming 1 10-05-2005 05:10 PM
how to write a simple c prog to call a script RajRed Linux - Software 1 10-05-2005 02:57 PM
Urgent: Call a C program through Linux shell script nuwandee Programming 14 04-10-2004 07:31 PM
How to call the arp linux shell command from within a perl program Bassam Programming 1 03-11-2004 02:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration