The problem started when Sun and Netscape issued a joint press release on December 4, 1995 titled
Netscape and Sun Announce JavaScript, the Open, Cross-Platform Object Scripting Language for Enterprise Networks and the Internet. (Whew!) You see, up to that point what we now know as JavaScript was known as LiveScript.
According to
JavaScript: Past, Present and Future, the Netscape team initially considered using Java as a way to make web pages "more dynamic" but decided that Java was a better option "for buliding components and not simple, easy-to-tweak scripts". So they built their own language and called it LiveScript. It had some similarities to Java, but Java itself has similarities with C and Pascal. The nice thing about LiveScript was that it was truly a scripting language, so you didn't need to compile the code and you didn't need to design classes — you just started coding.
So why was LiveScript renamed to Java? It's one of those classic marketing mistakes that are made when the gap between the marketing people and the people who build and design the technology is too great. True, JavaScript could be used to control applets to some degree — to it, applets were just another component of a web page — but the integration going back the other way around was lacking.
The renaming would have made sense if JavaScript was a subset of Java, but the fact is that learning one of the languages doesn't give you any expertise in the other. They are truly independent.
JavaScript is not Java. End of discussion!