User tern.js with Java code