separate out static dependencies of core on java backend

@andreistefanescu @yilongli @cos please review