fix #stdout function in java backend

@andreistefanescu please review.