add java code to index.html