you can use the jtag to communicate with the integrated terminal in
the debugger, but not with user programs (no description,
how to access the jtag device from user pc programs)
under your debugger NIOS II harwareconfiguration->Tab "Target Connection"
you can set NiosII Terminal communication device to your jtag_uart.
in your system library properties you can set stdout,stderr,stdin to your
jtag_uart, then you can use normal printf("hello world").
otherwise
FILE* jtfp;
...
jtfp = fopen ("/dev/jtag_uart","rw");
if(jtfp) {
fprintf(jtfp,"JTAG UART OPEN FOR DEBUG\n");
}