They have nothing to do with each other.
Java is statically typed, compiles, runs on its own VM.
Javascript is dynamically typed, interpreted, and runs in a browser. It also has first-class functions and anonymous functions, which Java does not. It has direct access to web-page elements, which makes it useful for doing client-side processing.
They are also somewhat similar in syntax, but that's about it.