I am creating a named pipe using JNI by calling the mkfifo() command. I am using mode = 0666.
I am then trying to write into the pipe using Java, but I get stuck whi
That's how named pipes on *nix work. You're getting stuck at opening the pipe. Opening a fifo for writing will block until someone opens it for reading.
You'll deadlock if you try to read/write to the pipe from the same thread synchronously, you'ld have to either switch to NIO, or create one thread that reads from the fifo and one thread that writes to it.