change some debug printing in java backend to print to stderr instead of stdout