separate out static dependencies of core on java backend

@andreistefanescu @yilongli @cos please review
oh yes, thank you, I forgot to do that.