Is System.out stream synchronized?

Hi,
I am using the System.out stream to print various logging messages
by different threads.
I am using System.out.println
Is this thread-safe?
The messages themselves are only for development, they are not essential,
that's why I haven't bothered to set up any synchronization mechanism...

Hi,
are you sure?
On what grounds do you claim this?
The Javadocs do not specify it.
Thanks.If you question the correctness, it's time for you to do your own research.

Similar Messages

  • Reading System out stream ?

    Hi,
    I don't know whether I am asking a stupid question or not . But my problem is that in my thousand lines of code i wrote number of System.out.println(".....") statements to describe various situations / state of program which write those strings of messages to standard output i.e console . Here at this point of situation I was wondering that is there a possible way that i could read System.out stream by concurrently running a thread who could look on this stream and could redirect it to a file where i want. By achieving this I don't need to go at every piece of code where i have written System.out.println(".....") and change it to get desired result.
    If it is possible , please let me know ?
    Thanks in advance,
    Hemant.

    A suggestion - next time, set up a boolean - call it maybe "debugFlag" and check it befor a system.out write. That way all that's needed is to reset the flag and recompile when it goes to "production".
    And then the other possibility is to use your editor and do some global change all in your code.

  • Redirecting System.out stream to a TextArea

    I hope this isn't a stupid question--I'm blanking pretty hard.
    I want to use System.setOut() to direct standard output to a TextArea within a Frame. Is there a way to setup a TextArea to receive text from an output stream, or is an intermediary of some sort necessary?
    I feel like this is pretty easy, but I'm stumbling. That's what I get for doing J2EE for a year rather than GUI. :P
    Any input is appreciated!

    Here's the compiled and tested code...I learned some good stuff from this link as to why my simpler approach didn't work:
    http://www.devx.com/upload/registered/features/javapro/1999/11nov99/tl1199/tl1199.asp
    Here is my code:
      class OutRouter implements Runnable
        PipedInputStream pipeIn = null;
        JTextArea textArea = null;
        OutRouter( JTextArea ta, PipedOutputStream pos)
          try
            pipeIn = new PipedInputStream(pos);
          catch(IOException ioe)
            ioe.printStackTrace(System.err);
            System.exit(1);
          textArea = ta;
        public void run()
          String line = null;
          BufferedReader pipeReader = new BufferedReader(
            new InputStreamReader(pipeIn));
          try
            while(true)
              Thread.sleep(100);
              if(pipeIn.available() == 0)
                continue;
              line = pipeReader.readLine();
              if(line == null)
                continue;
              System.err.println("Line = " + line);
              final String fLine = line;
              SwingUtilities.invokeAndWait( new Runnable()
                {public void run()
                  { textArea.append(fLine + "\n"); }
          catch(InvocationTargetException ite)
          { ite.printStackTrace(System.err); System.exit(1); }
          catch(InterruptedException ie)
          { ie.printStackTrace(System.err); System.exit(1); }
          catch(IOException ioe)
          { ioe.printStackTrace(System.err); System.exit(1); }
      }

  • To redirect System.out stream output on swing's JTextArea

    Following is a program that needs to print output as follows:-
    EXPECTED OUTPUT ON GUI:_ In action block (datapayload value) In Routing block (argus value)
    PRESENT PROGRAM OUTPUT ON GUI_ In action block (datapayload value)
    please examine the below code and correct mistakes to get the expected output as given above.....
    I am not getting the second line as output on GUI i.e., In Routing block (argus value)
        import java.awt.*;
        import javax.swing.*;
        import java.awt.event.*;
        import java.io.*;
        public class Demo extends JFrame implements ActionListener
          JTextField datapayload;
          JLabel Datapayload;
          JButton submit;
          JTextArea textFieldName;
          public Demo()
             DemoLayout customLayout = new DemoLayout();     
             getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
             getContentPane().setLayout(customLayout);
             Datapayload = new JLabel("Enter DataPayload:");
             getContentPane().add(Datapayload);
             datapayload = new JTextField("abcd...");
             getContentPane().add(datapayload);
             submit = new JButton("submit");
             getContentPane().add(submit);
             textFieldName = new JTextArea(80,10);
             textFieldName.setEditable( false );
             JScrollPane scroll = new JScrollPane(textFieldName) ;
             scroll.setBounds( 10, 60, 225, 150 );
             getContentPane().add( scroll );
             submit.addActionListener(this);
             setSize(getPreferredSize());
           public void actionPerformed(ActionEvent e)
              String demodata=datapayload.getText();
                 textFieldName.append("In Action Block"+"\t"+demodata);  
              Demo pr = new Demo();                              
              pr.DemoRoute(demodata);
           public void DemoRoute(String argus)
                 textFieldName.append("In routing block"+"\t"+argus);
            public static void main(String args[])
                 Demo window = new Demo();
                 window.setTitle("Demo");
                 window.pack();
                 window.show();
        class DemoLayout implements LayoutManager
           public DemoLayout() {  }
           public void addLayoutComponent(String name, Component comp) {   }
           public void removeLayoutComponent(Component comp) {  }
           public Dimension preferredLayoutSize(Container parent)
             Dimension dim = new Dimension(0, 0);
             Insets insets = parent.getInsets();
             dim.width = 320 + insets.left + insets.right;
             dim.height = 240 + insets.top + insets.bottom;
             return dim;
           public Dimension minimumLayoutSize(Container parent)
             Dimension dim = new Dimension(0, 0);
             return dim;
           public void layoutContainer(Container parent)
             Insets insets = parent.getInsets();
             Component c;
             c = parent.getComponent(0);
             if (c.isVisible()) {c.setBounds(insets.left+90,insets.top+8,172,26);}
             c = parent.getComponent(1);
             if (c.isVisible()) {c.setBounds(insets.left+230,insets.top+8,172,26);}
             c = parent.getComponent(2);
             if (c.isVisible()) {c.setBounds(insets.left+230,insets.top+52,142,26);}
             c = parent.getComponent(3);
             if (c.isVisible()) {c.setBounds(insets.left+90,insets.top+100,472,268);}
        }  Edited by: 997189 on Mar 31, 2013 8:52 AM

    Hi,
    change your actionPerformed() method as below to get the required output.
    public void actionPerformed(ActionEvent e)
              String demodata=datapayload.getText();
                 textFieldName.append("In Action Block"+"\t"+demodata);  
              //Demo pr = new Demo();      You are creating a new object to all DemoRoute method. This is the problem                         
              //pr.DemoRoute(demodata);
                 this.DemoRoute(demodata);
    }And also my suggestion is follow java coding conventions while coding

  • Synchronized use of System.out.println()

    So I am again at the point of part of my program running ahead of itself out of the call stack and ruining the sequence or order of printing.
    I read that System.out.println() is synchronized so how may it be used to wait() until notified to continue and not ruin the output?

    jverd wrote:
    Always Learning wrote:
    YES SIR EJP! SIR! I thank you for the assistance because using only System.out and synchronizing worked beautifully.You said you're not using multiple threads. If this is true, then there's no reason to synchronize anything. The output will appear on System.out in exactly the order you send it there.
    Nos if only I could figure out dependencies to make it work with out and err.You have to stop and think about it for a minute. You know that when you call println() on either one of those two streams, the output may be buffered an not necessarily go immediately to the console. From that you can reason that if you call out.println() first, and then err.println(), that you could end up with err's buffer getting flushed first, and the output appearing on the console in a different order than that in which your code executed the calls.
    You are of course not surprised by this, given that you know that out and err are completely independent and just happen to end up at the same destination in this particular case.
    So, as a first guess, you might reasonably think that, since buffering is obviously the culprit here, calling flush() on each stream after each print() or println() call should eliminate the problem. In a multithreaded environment, this wouldn't be sufficient, of course, but it's a logical approach to try here.
    Another tidbit to make note of is that the System class has setOut() and setErr() calls. Since you're looking at out and err in the same console, you presumably don't care about the distinction between them (which makes me wonder why you're using them both in the first place, instead of just using one). If you're just going to mush them together into the same console anyway, then you can use setOut() or setErr() to make them the same stream, and things will be ordered as you expect.Very interesting Jverd and I think there may yet be life in what I would like to do. I did not know or was not immediately aware of these things. I will give it a try.
    To answer your question, I am using them both because, like logging, they are distinct in the Eclipse console (black for out and red for err). With your patch I just tried that distinction has faded but the output is sequenced the same so I do appreciate you noting this. Learn something new in Java each time I am doing a project. I considered using logging and putting errors in a window but I am not sure if I should do that; just not enough experience with it.
    Edited by: Always Learning on Oct 23, 2011 9:28 AM

  • Redirect system.out.println() to a file

    hi all,
         how can i redirect all the console prints to a txt file in java application? i have used system.out oftenly in many class throught the
    application. is there any way to redirect all those console prints to a
    txt file by converting or assigning the System.out stream to a stream for filewriter or
    somthing like that, so that whenever system.out.println() is executed
    the content is written to a file insted of on the console.
    thanks in advance
    Sojan

    Actually,System.setOut(new PrintStream(new FileOutputStream("output.txt"), true));
    System.setErr(System.out);since setOut wants a PrintStream and not just some OuputStream...

  • Redirecting System.out to a JTextArea

    How can I redirect the System.out Stream into a JTextArea?
    I found the method System.setOut(PrintStream out) but I don't know
    how to get the PrintStream of my TextArea.

    I don't know if this is the most efficient way but it provides an example of using Pipes:
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TextAreaStream extends JTextArea implements Runnable{
         private static final PipedOutputStream _pipeOut = new PipedOutputStream();
         static{
                   System.setOut( new PrintStream(_pipeOut) );
         private InputStream _pipeIn;
    private byte[] buffer = new byte[256];
         public TextAreaStream(){
              this(1,10);
         public TextAreaStream(int numRows, int numCols){
              super(numRows, numCols);
              Thread t = new Thread(this);
              t.setDaemon(true);
              t.start();
              try{
              pipeIn =  new BufferedInputStream(new PipedInputStream(pipeOut));
              catch(IOException e){
                   System.err.println("Error creating pipe: "+e);
         public void run(){
              while(true){
                   try{
                        //blocks at read
                        int bytesRead = _pipeIn.read(buffer);
                        append(new String(buffer,0,bytesRead));
                   catch(IOException e){
                        System.err.println(e);
         public static void main(String[] args){
              JFrame f = new JFrame();
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JTextArea text = new TextAreaStream();
              text.setBorder(BorderFactory.createTitledBorder("System.out"));
              f.getContentPane().add(text);
              //Add an input component
              JPanel north = new JPanel(new FlowLayout(FlowLayout.LEFT));
              final JTextField field = new JTextField(25);
              north.add(field);
              north.add(new JLabel("Add text, press Enter"));
              f.getContentPane().add(north, BorderLayout.NORTH);
              field.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        System.out.println(field.getText());
                        field.setText("");
    f.setSize(600, 400);
              f.show();
    }

  • How does one intercept System.out.println stream.

    If you want some functionality wherein when you call System.out.println - the stream gets written to System.out AND additionally does something else (e.g. send mail).
    AND
    You do not want to write a new class/method to do so and replace all System.out.println in your source base with this new class/method;
    Then how would you be able to achieve this. Thanks in advance.

    Here is the basic code, you may need to tune performance. I havent compiler or tested it, but it should give you a good idea.
    public class OutputStreamCollection extends OutputStream{
    private OutputStream[] outs = new OutputStream[0];
    public synchronized void addOutputStream(OutputStream argOut) {
    OutputStream[] old = outs;
    outs = new OuputStream[old.length + 1];
    System.arraycopy(old,0,outs,0, old.length);
    outs[outs.length - 1] = argOut;
    public syncrhonized void write(int data) {
    for(int i = 0; i < outs.length; i++) {
    outs.write();
    public synchronized void write(byte[] data, int offset, int length) {
    for(int i = 0; i < outs.length; i++) {
    outs[i].write(data, offset, length);
    nor the following code, will print and log to respective files whatever is going to stdout or stderr
    OutpputStreamCollection out = new OutputStreamCollection();
    out.addOutputStream(System.out);
    out.addOutputStream(new FileOutputStream("stdout.log"));
    System.setOut(out);
    OutpputStreamCollection err = new OutputStreamCollection();
    out.addOutputStream(System.err);
    out.addOutputStream(new FileOutputStream("stderr.log"));
    System.setOut(err);
    you can write adapter classes to process the stream in any way you need, like logging with log4J, or sending mail depending on some crieteria.
    Hope it helps.

  • Capturing System.out messages

    Hey all,
    Just wondering what the easiest way to capture System.out messages of a process, and store these messages in an Array, Vector, or a Buffer where I could read these messages line by line later?
    Basically one process System.out.println()'s information I need to use as a variable for a second process. Any help would be greatly appreciated.
    Thanks!

    Here is a class which redirects standard out and err to a JscrollPane.
    import java.io.*;
    import javax.swing.*;
    public class EOutputConsole extends JScrollPane {
      Object lock = new Object();
      final JTextArea text = new JTextArea(10,30);
      PrintStream consoleOut;
      public EOutputConsole() {
        setViewportView(text);
        setupOutput();
       * An extention of PrintStream that notifies a lock
       * as it's executing its write method. This tells
       * an output console that it has input ready.
      class ConsolePrintStream extends PrintStream {
        Object lock;
        public ConsolePrintStream(Object lock, OutputStream out) {
          super(out);
          this.lock = lock;
        public void write(byte[] buf,
                          int off,
                          int len) {
          synchronized(lock) {
            lock.notify();
            super.write(buf,off,len);
       * A class that extends PrintStream to throw away all
       * input sent to it. This is used to supress standard out
       * and speed up test model runs with debugging output
      class NullPrintStream extends PrintStream {
        public NullPrintStream(OutputStream out) {
          super(out);
        public void write(byte[] buf,
                          int off,
                          int len) {
      public void suppressStandardOut() {
        // create a dumby temp file to use as an output stream
        // nothing will ever actually be written to the file
        try {
          File dumbFile = File.createTempFile("notme", "not1337");
          dumbFile.deleteOnExit();
          PrintStream out = new NullPrintStream(new FileOutputStream(dumbFile));
          System.setOut( out );
          System.setErr( out );
        } catch(IOException ioe) {
          System.out.println("Error supressing standard out");
          ioe.printStackTrace();
      public void availableStandardOut() {
        System.setOut( consoleOut );
        System.setErr( consoleOut );
      private void setupOutput() {
        Thread printer = new Thread( new Runnable() {
            public void run() {
              PipedInputStream pipe = new PipedInputStream();
              BufferedReader in = new BufferedReader
                (new InputStreamReader( pipe ));
              try {
                PipedOutputStream pipeOut = new PipedOutputStream(pipe);
                consoleOut = new ConsolePrintStream(lock, pipeOut);
                System.setOut( consoleOut );
                System.setErr( consoleOut );
              catch (Exception e) {
                System.out.println("Failed to create Pipe for System.out");
                e.printStackTrace();
                return;
              try {
                for(;;) {
                  while(!in.ready()) {
                    synchronized(lock) {
                      lock.wait();
                  text.append(in.readLine()+"\n");
                  verticalScrollBar.setValue(verticalScrollBar.getMaximum());
              } catch (Exception e) {
                System.out.println(e);
                e.printStackTrace();
        printer.setDaemon(true);
        printer.start();
    }

  • How to capture System.out, done by another program

    Hi All,
    My application runs other application in back. How can I capture system.out.println() written by another application & display via dialog box.
    Like :execl() or execv() function in C runtime library. Where every printf() message printed to passed buffer.
    Thank you,
    Avin Patel

    You can create an InputStream from a started process. Then read all the bytes from the inputstream and write them to an outputstream (like System.out)
    Process p = Runtime.getRuntime().exec(COMMAND);
    InputStream is = p.getErrorStream();   //Or another stream
    int[] buffer = new int[128];
    while((read = is.read(buffer)) != -1){
    System.write.out(buffer, 0, read);
    }

  • Odd behaviour appending to System.out PrintStream

    I've run into some unexpected behaviour with the System.out PrintStream object. When I append characters to it I'm expecting the characters to be displayed on screen much like I'd expect the characters to be written to a file using a FileOutputStream. What seems to happen is that the characters are written to the PrintStream but the process continues on and on adding some unseen character (newline?). The following code generates the behaviour I"m talking about. The main method is a bit contrived but does the job. You'll likely have to increase your heap size to run this (-Xmx512m worked for me):
    {code}
    package output.stream.problem;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.io.Reader;
    import java.io.StringReader;
    import java.util.HashMap;
    import java.util.Random;
    * A class used to introduce transition/transversion errors into DNA sequences. Error types are introduced
    * with equal probability and are mutually exclusive.
    * @author twb
    public class GenomicDNAMutator {
         private HashMap<Integer,Character> mutations=new HashMap<Integer,Character>();
         private Reader sequenceSource;
         private Random rand=new Random();
         private double errorRate=-1;
         public GenomicDNAMutator(String fileName, double errorProbability) {
              try {
                   sequenceSource=new FileReader(fileName);
                   errorRate=errorProbability;
              } catch (FileNotFoundException fnfe) {
                   System.err.println("Could not open file "+fileName);
                   fnfe.printStackTrace();
         public GenomicDNAMutator(File file, double errorProbability) {
              try {
                   sequenceSource=new FileReader(file);
                   errorRate=errorProbability;
              } catch (FileNotFoundException fnfe) {
                   System.err.println("Could not open file "+file);
                   fnfe.printStackTrace();
         public GenomicDNAMutator(Reader is, double errorProbability) {
              sequenceSource=is;
              errorRate=errorProbability;
         public void process() {
              this.process(System.out);
         public void process(OutputStream os) {
              BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(os));
              BufferedReader br=new BufferedReader(this.sequenceSource);
              char nucleotide;
              char[] a=new char[]{'T','C','G'};
              char[] t=new char[]{'A','C','G'};
              char[] c=new char[]{'A','T','G'};
              char[] g=new char[]{'A','T','C'};
              char[][] errorMatrix=new char[][]{a,t,c,g};
              int matrixIndex=-1;
              try {
                   int count=0;
                   int i=0;
                   while((i=br.read())!=-1) {
                        nucleotide=(char)i;
                        count++;
                        double d=rand.nextDouble();
                        if(d<=this.errorRate) {
                             switch(nucleotide) {
                             case 'A':
                                  matrixIndex=0;
                                  break;
                             case 'T':
                                  matrixIndex=1;
                                  break;
                             case 'C':
                                  matrixIndex=2;
                                  break;
                             case 'G':
                                  matrixIndex=3;
                                  break;
                             int pos=rand.nextInt(3);
                             this.mutations.put(count,nucleotide);
                             nucleotide=errorMatrix[matrixIndex][pos];
                        bw.append(nucleotide);
                   bw.flush();
                   bw.close();
              } catch (IOException ioe) {
                   System.err.println("Could not read the input source");
         public Reader getIn() {
              return sequenceSource;
         public void setSequenceSource(Reader in) {
              this.sequenceSource = in;
         public static void main(String[] args) throws Exception {
              StringBuilder sb=new StringBuilder();
              for(int i=0;i<30000000;i++) {
                   sb.append('A');
              System.out.println("Mock sequence built");
              GenomicDNAMutator gdm=new GenomicDNAMutator(new StringReader(sb.toString()),1d/100d);
              * Run the program using one of the process statements
              gdm.process(new FileOutputStream(new File("c:/text.txt")));
    //This one uses the System.out PrintStream object
    //          gdm.process();
              System.out.println("done");
    {code}
    I see this behaviour with java 1.6.0_10-beta and java 1.5.0_11
    Thanks for any insight you can give to this.
    - Travis

    twb wrote:
    I've run into some unexpected behaviour with the System.out PrintStream object. When I append characters to it I'm expecting the characters to be displayed on screen much like I'd expect the characters to be written to a file using a FileOutputStream. What seems to happen is that the characters are written to the PrintStream but the process continues on and on adding some unseen character (newline?). The following code generates the behaviour I"m talking about. The main method is a bit contrived but does the job. You'll likely have to increase your heap size to run this (-Xmx512m worked for me):Yes, this is the case. If you look at the javadoc for PrintStream it talks about the "auto-flush on newline" feature. what is your question?

  • System out on Dual Monitor systems

    Hi,
    I am trying to write an application running on single processor, but dual monitor facility. So differnet monitor must get differnet display from same process.
    May I know how can I capture the monitor standard output. I know we have System.out that is set to standard monitor, in this case I "think" it will consider the first monitor has standard output. So, how can I capture actual output stream to each monitor so that I can set the system out property to which ever monitor I wish.
    Thanks
    HKG...

    I don't understand. System.out and System.err write to the standard out and err streams. When running Java in a command window under a GUI environment like Windows, Mac OS or Unix or Linux with X-based graphical displays, these streams will be default be displayed in the shell window that started the program. This window will be on what every display you placed it, the Java program has no control.
    If the Java program is a GUI (AWT, Swing or SWT), then System.out and System.err output still goes (by default) to whatever shell window started the program or into the bit bucket if no shell windows as associated with starting the program.

  • Is it possible to recreate System.out after it's closed?

    Hi,
    Can anyone tell me why the close() call on System.out prevents me from opening the standard out stream?
    import java.io.BufferedOutputStream;
    import java.io.FileDescriptor;
    import java.io.FileOutputStream;
    import java.io.PrintStream;
    public class Test {
      public static void main(String[] args) {
        System.out.println("Hello");
        System.out.close();
        System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.out), 128), true));
        System.out.println("Hello again");
    }

    My problem actually stems from the fact I'm using Log4J but I have a native piece of code (no source) that writes to standard out. I want this output in a seperate file. The only way I have found to redirect it to a file is by closing the standard out. I then need to 'reopen' standard out so messages from thirdparty libraries using standard out are captured. Ideally I would like this to work.
                        PrintStream stdout = System.out;
              try {
                   System.setOut( new PrintStream( new FileOutputStream(filename)));
              catch (FileNotFoundException ex) {
              doNativeStuff();
              System.setOut(stdout);
         

  • How do you change system.out.println colour?

    Hi, I am developing some basic rmi client/server applications, I have an 2D array on a central server being read/written by remote clients. all the development is using system.out. statements at the moment (hopefully being replaced by GUI later) my question is when a client remote calls a read operation, and reads an array location, eg x3, y4 I want to print the location contents in a different colour to indicate the read, at the moment the displayArray() simply has nested for loops to cycle through the array and System.out.println statements to get it to the screen. I wonder is there a simple way to change the colour of system.out type statements? thanks for any help

    I could be wrong, but I don't think that is possible. The System.out and other streams are just streams of characters, and doesn't contain any data about the characters. You could possibly get it to work if you knew which terminal the stream was going to and if the terminal had escape commands that could set colors. BBS browsers have that functionality, but I think that would be a hard path to follow.
    If you are printing out a lot of data and need some color to aid it's readability, try printing directly to your graphic context:
    Graphics g = getGraphics();
    g.setColor(Color.white);
    g.drawString("Hello",100,100);

  • Invoking Java from C and capturing System.out

    Hi,
    I know very little about C but have a question related to invoking a Java process from C. Perhaps someone can help me.
    I've been looking at the example at http://java.sun.com/docs/books/jni/html/invoke.html and seen how to invoke my Java program with:
    (*env)->CallStaticVoidMethod(env, cls, mid, args);
    in their example the Java program prints one line to System out with:
    System.out.println("Hello World " + args[0]);
    and says running the program produces:
    Hello World from C!
    What I want to know is, how in the C program can I capture the output the Java program sends to System.out, as I want to do something with the output other than have it print into the console.
    Hope that makes sense.

    I'm not totally clear on your question but I'll take a stab.
    It seems to me like you are trying to get the output from a java program into a C program. If this is the case then there are many ways to do this - many of which are more simple that using JNI. However, if you absolutely must use JNI for this application then I suggest you take some more time to learn about C and JNI as I imagine this sort of thing is non-trivial and will required a level of understanding of C that you currently don't have. You may also want to cross-post onto the JNI forum.
    If you can do this without using JNI then I'd suggest doing the standard fork/exec/pipe routine. This means, that in your C program you will call the functions fork (to create a new process that is subordinate to the currently running one), exec (in the subprocess which will replace the current program image in memory with that of another program you wish to execute, in this case, a JVM with a running application), and popen (which creates a "pipe" between the standard output of the Java program [System.out] and some input stream in the C program).
    Finding an example of a program that does this fork/exec/pipe pattern on the web shouldn't be too hard. Hope this helps.
    -mike

Maybe you are looking for

  • HP envy m6-n113dx trackpad malfunctioning

    I have a brand new m6-n113dx that has a useless trackpad.  It constantly jerks around randomly, speeds up/slows down, twitches and otherwise has a mind of its own. So far, all tech support has failed to permanently fix the issue.  This is what has be

  • Customer payment report

    I have an requirement, user ask me to generate a customer report to them on monthly basis, i would like to know which table can be use? The report need to shown the customer payment date( i think use entry date would be better), and for which invoice

  • OSB: Is it possible to change throttling settings with WLST?

    Hi all, I am trying to find a solution to change the throttling settings of a business service with WLST, since it is not possible to set it in the customization file. I already know the parameter alsbImportPlan.setPreserveExistingOperationalValues(b

  • Ora 28009

    Ora 28009 : could not connect as sysdba or sysoper. what is the problem how to login. currently i am loging using scott account and then changing to sysdba account using connect usename/password as sysdba please help

  • FRM-47321: Data used to populate tree is invalid

    FRM-47321: Data used to populate tree is invalid I am populating from a record group Any Suggestion will be appreciated