Note that there are some explanatory texts on larger screens.

plurals
  1. POstdin/stdout communication between Java program and C program under 64 bit windows 7
    primarykey
    data
    text
    <p>I have a C program which gets spawned from a Java program. The C program is mine, while the Java program is third party. The Java program somehow sets things up so that it communicates with my program via stdin/stdout.</p> <p>The system has been working fine under 32-bit Windows XP for years. I have just purchased a new machine with 64-bit Windows 7. When I ran the Java program (from a "dos" box), it launched my program successfully, and it sent my program a command, which my program successfully acted upon. But when my program went back to its loop with</p> <pre><code>inputchar = getc(stdin); </code></pre> <p>the getc(stdin) never returns.</p> <p>A clue: I know almost nothing about Java and I did have some trouble getting it to run in the first place. It seemed that after installing it from java.com, if I went to a "dos" box and typed "java", I just got an unrecognized command error. I then found a java.exe on windows\sysWOW64 so I typed "windows\sysWOW64 java -jar blah blah..." and then the program looked like it was running (at least up until the getc(stdin) problem).</p> <p>Any idea what could be going wrong? Do I need a special 64-bit-Windows-7 Java? Is it possible that its just a badly written java program who's bugs only manifest themselves when running on a new OS? Or is it more likely to be me?</p> <p>EDIT: My C program runs fine on its own (i.e. not spawned from java) on the 64bit windows 7 machine.</p> <p>EDIT: If I type "\windows\syswow64\java -version", then I get...</p> <pre><code>java version "1.6.0_18" Java(TM) SE Runtime Environment (build 1.6.0_18-b07) Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing) </code></pre> <p>EDIT: On the old XP box the java version was 1.6.0_17-b04</p> <p>EDIT: I did not re-build my C program for the new machine. I just copied the old 32 bit version.</p> <p>EDIT: the first "command" that the java program sends is a string ending in a "line feed" character (ASCII 10).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload