Java and JavaScript have NO relation to each other. The term 'JavaScript' was a poor marketing decision by Netscape and Sun Microsystems for gawd knows what reason. That's what marketing people do, apparently.
The actual, modern day name for what used to be JavaScript has been ECMAScript for many years. The term 'JavaScript' is now merely a quaint term of nostalgia. Keep that in mind when you see it.
My brief history of ECMAScript:
1) Netscape creates a 'safe' web scripting language they called 'Mocha'.
2) They change its name to 'LiveScript'.
3) Marketing dweebs at both Netscape and Sun get together and agree that Netscape can change the name to 'JavaScript'. You figure out why. No one else has.
4) Adobe and Microsoft want in on the action and toss more scripting code onto the Internet called 'ActiveScript' and 'JScript'. It wreaked havoc on the Internet.
5) The ECMA (European Computer Manufacturers Association) attempt to bring sanity to the situation and combine all three into a standard specification called 'ECMA-262' or 'ISO/IEC 16262'. But that's annoying technobabble, so it's simply called 'ECMAScript'.
And again, there never has been ANY relationship between Java and JavaScript. None. Zero. Nothing. They only share the letters J A V A. The end.
Wikipedia.org is your pal. Look up ECMAScript and read all about it.
tl;dr So why is Java doing this to us again? Or is it Apple?