JavaScript was intentionally named in order to ride the Java hype train, so this wasn't accidental.
Prior names included Mocha and LiveScript until Netscape/Sun forced the current name.