I curious about this too since JAVA is easy to exploit by mischief makers.
Java is something else entirely -- a language for apps and applets.
JavaScript actually has little or nothing to do with Java. The name was a largely bogus attempt to cash in on the name of Java and build an apparent association.
Although it was developed under the name Mocha, the language was officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but it was renamed JavaScript[10] when it was deployed in the Netscape browser version 2.0B3.[11]WikipediaThe change of name from LiveScript to JavaScript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator web browser. The final choice of name caused confusion, giving the impression that the language was a spin-off of the Java programming language, and the choice has been characterized as a marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new web programming language.[12][13]
Java and Javascript, although similarly named, are two completely different things (but neither is immune to exploit)