Capturing output form console

  • Thread starter kaushik.krishnakumar
  • Start date
K

kaushik.krishnakumar

My java code is using native method calls.The native code prints out
lots of data using "printf".Is is possible to capture such outputs from
the native code so that the same outputs can be displayed on the GUI.
An example code of a few lines would be of tremendous help because i
am a newbie programmer in Java
 
O

Oliver Wong

My java code is using native method calls.The native code prints out
lots of data using "printf".Is is possible to capture such outputs from
the native code so that the same outputs can be displayed on the GUI.
An example code of a few lines would be of tremendous help because i
am a newbie programmer in Java

I'm assuming you're not doing native calls via JNI, else you probably
wouldn't be a newbie programmer in Java.

If you can invoke a native program via Runtime.exec(), you'll get a
Process object, which has a getOutputStream() method.

Read the documentation at
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Process.html

- Oliver
 
K

kaushik.krishnakumar

I'm making native calls only but i'm new to JNI. My project requires to
pass values from GUI to the backend native code.There needs to be a
continuous logging of printf form the native code and be displayed in
the GUI.The native code returns few values but i also need to monitor
the output which is printed on the console by the native code. So is
there any methos through which i can capture those values ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top