Wrote initial java portion.