Added Java version for AI injection and fixed JS