cpp: Further java removal and fixes