In short—nothing. But the two languages make a fascinating comparison. Java was developed over multiple years to achieve the goal of "write once, run anywhere." JavaScript was developed rapidly but went on to achieve that goal pretty much by accident.
Credits: Talking: Geoffrey Challen (Assistant Professor, Computer Science and Engineering, University at Buffalo). Producing: Greg Bunyea (Undergraduate, Computer Science and Engineering, University at Buffalo).
Part of the https://www.internet-class.org online internet course. A blue Systems Research Group (https://blue.cse.buffalo.edu) production.