Fix java problems