221

Since JavaScript is not derived from Java, why does it have "Java" in the name?

Matthew
  • 28,056
  • 26
  • 104
  • 170
  • http://www.w3schools.com/tags/att_script_type.asp – Ben Shelock Jan 07 '10 at 07:01
  • Ben: I can't figure out what your link has to do with my question. – Matthew Jan 07 '10 at 07:03
  • 1
    It says the attribute can be "text/ecmascript". Gives what others said a bit of context. – Ben Shelock Jan 07 '10 at 07:06
  • 9
    http://en.wikipedia.org/wiki/JavaScript#History – zombat Jan 07 '10 at 07:08
  • 9
    Why is Java called Java, which is the name of island, If it has nothing to do with island? – YOU Jan 07 '10 at 07:21
  • 1
    Technically, it is called Ecmascript, but no one really says that. – Tyler Mar 19 '10 at 07:02
  • 4
    ECMAScript is the standards name for it. If you wanted to be super-specific, you'd call it that to make sure everyone knew what implementation you were talking about, but in general Javascript is perfectly fine. – Annath Mar 19 '10 at 07:06
  • 12
    For the same reason Apple Jacks is called Apple Jacks even though it doesn't taste like apples – Chris McCall Mar 19 '10 at 07:19
  • 99
    "Java is to JavaScript what Car is to Carpet" – Josh Lee Mar 19 '10 at 07:24
  • Am I having a deja-vu or what? Wasn't the exact same question with close to the exact same answers here posted sometime back? – Anurag Mar 19 '10 at 09:37
  • Marketing. I would say marketing. – Stefano Sanfilippo Oct 21 '13 at 07:51
  • 2
    Hamburgers and ham are both foods that are meat products, just as JavaScript and Java are both programming languages with a C-influenced syntax. But other than that, they don’t have much in common and are fundamentally different right down to their DNA. its just when Netscape and Sun came together they gave LiveScript the name as JavaScript, so it can play a role as complementing to Java in browser. https://twitter.com/SteeLx/status/433855540360249345 – STEEL Feb 13 '14 at 07:00
  • 4
    It is amazing how much stuff on SO is considered off topic... This policy more hurts than helps, imso. – Fernando Basso Dec 24 '15 at 21:46
  • 3
    Why is that "off-topic"...? What would be the suitable place for this question then, please? – cedbeu May 08 '16 at 05:08
  • 1
    It's not asking for help with code. –  Feb 22 '19 at 13:56

10 Answers10

190

From an interview made to its creator Brendan Eich:

InfoWorld: As I understand it, JavaScript started out as Mocha, then became LiveScript and then became JavaScript when Netscape and Sun got together. But it actually has nothing to do with Java or not much to do with it, correct?

Eich: That’s right. It was all within six months from May till December (1995) that it was Mocha and then LiveScript. And then in early December, Netscape and Sun did a license agreement and it became JavaScript. And the idea was to make it a complementary scripting language to go with Java, with the compiled language.

Community
  • 1
  • 1
Christian C. Salvadó
  • 807,428
  • 183
  • 922
  • 838
  • 31
    So there was some connection. I wouldn't have anyway believed it was coincidence! – nawfal Jul 22 '14 at 18:14
  • 7
    @nawfal probably sun has said: server side we have java, then for scripting let's called it javascript... the only thing they have similar is that both need an interpreter to run: java needs JVM, javascripts need a browser but nothing more. Would have been javascript so famous today if they would not have it called that way? – albanx Oct 31 '15 at 20:45
  • 7
    "the idea was to make it a complementary scripting language to go with Java, with the compiled language." But did such a thing ever happen? – ineedahero Oct 19 '16 at 20:23
  • 2
    @ineedahero Yes, see groovy http://groovy-lang.org/ – Byron Whitlock Jul 13 '17 at 17:37
  • 3
    "Originally called LiveScript, the language was created with syntax that was superficially similar to Java in many ways in order to tap into the Java developer community, though in fact there is no direct relationship between the two languages." **ref:** https://www.infoworld.com/article/3441178/what-is-javascript-javascript-and-ecmascript-explained.html – samus Oct 02 '19 at 17:40
144

JavaScript was originally named Mocha, later it was renamed to LiveScript, and then to JavaScript.

The LiveScript to JavaScript name change came because Netscape and Sun did a license agreement.

The language was then submitted for standarization to the ECMA International Organization. By that time, Netscape didn't allow the use of the "JavaScript" name, so the standarized language is named ECMAScript.

JavaScript isn't actually an open name. It is currently a trademark of Oracle (formerly Sun).

There still a lot of confusion, some people still think that JavaScript, JScript, and ECMAScript are three different languages.

ECMAScript is the "standards" name for the language.

JavaScript is technically a "dialect" of ECMAScript, the Mozilla Foundation can use "JavaScript" as the name of their implementations (currently present on the Rhino and SpiderMonkey engines).

In the early days, Microsoft decided also to do what Netscape was doing on their own browser, and they developed JScript, which is also an ECMAScript dialect, but was named in this way to avoid trademark issues.

M. Justin
  • 14,487
  • 7
  • 91
  • 130
Christian C. Salvadó
  • 807,428
  • 183
  • 922
  • 838
  • 35
    This answer, while an interesting history of JavaScript's name, doesn't really answer the question of *why* it has "Java" in its name. Your other answer solves the question I was asking, which is why I accepted that one. – Matthew Aug 31 '13 at 00:10
  • 8
    why aren't the two answers merged into one? this seems like a way to get more votes... lol – igorsantos07 Apr 28 '18 at 01:48
40

Java is to Javascript what Car is to Carpet.

"The language's name is the result of a co-marketing deal between Netscape and Sun, in exchange for Netscape bundling Sun's Java runtime with their then-dominant browser."

- http://en.wikipedia.org/wiki/JavaScript#History

Community
  • 1
  • 1
Sampson
  • 265,109
  • 74
  • 539
  • 565
  • 2
    I doubt you'll get the same results as Greg with this :-) http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java – Vinko Vrsalovic Jan 07 '10 at 06:59
  • We must read the same books :) – Sampson Jan 07 '10 at 07:00
  • 18
    Sorry but I'm tired of hearing that platitude every time this issue comes up. – cletus Jan 07 '10 at 07:08
  • 4
    You're too well-read, Cletus ;) But in all fairness, the OP likely has not heard it, and as such will benefit in a way that you won't from it. – Sampson Jan 07 '10 at 07:09
  • 4
    +1 To that point, I am well versed in JavaScript and had never heard that comparison before. – Doug Neiner Jan 07 '10 at 07:10
  • @Vinko Vrsalovic: Greg read it from here : http://stackoverflow.com/questions/58640/great-programming-quotes/58693#58693 – Michel Gokan Khan Jan 07 '10 at 07:39
  • 16
    Confusing. Almost all cars have carpet lining the floor. Are you saying almost all Java programs have JavaScript inside them? It'd be more accurate to say: They both start with the same 4 letters. – Trenton Jul 23 '15 at 18:54
  • 2
    Yeah I agree @Trenton , it maybe best to say Java is to Javascript as Car is to Carscript. – SparkleGoat Feb 23 '17 at 20:12
  • 2
    @SparkleGoat Perhaps "Ham is to Hamster" is a better explanation? :) – Sampson Feb 25 '17 at 20:11
  • 2
    Unlike car and carpet, the "Java" in "Javascript" is intentionally there due to a deal with Netscape and Sun. – Viliami Jun 19 '17 at 14:21
  • @Viliami It was there for marketing purpose; beyond sharing similar c-style syntax, JavaScript and Java are unrelated. – Sampson Jul 21 '17 at 19:13
13

It was originally called Mocha, renamed to LiveScript, and then renamed to JavaScript. JavaScript itself is a trademark of Sun Microsystems -- the official standard is just called ECMAScript.

Further confusing the matter, Microsoft has decided to call their version JScript. JScript is not at all related to J++, a Microsoft-implemented Java whose name undoubtedly is designed to cause confusion with C++.

Michael Greene
  • 10,343
  • 1
  • 41
  • 43
12

The project was originally called Mocha, then renamed to LiveScript, and finally to JavaScript when Netscape and Sun did a license agreement. The idea at the time was to make it a scripting language complimentary to Java.

My Source.

Annath
  • 1,262
  • 10
  • 20
6

We were obsessed with naming things after coffee in the 90's.

I know... what were we thinking?!

JP Silvashy
  • 46,977
  • 48
  • 149
  • 227
3

It was a marketing ploy cooked up by Netscape since Java was the big buzz word at the time. Originally it was called LiveScript. Which was probably a better name in hindsight.

Darrell Brogdon
  • 6,843
  • 9
  • 47
  • 62
3

The language has similarities to C-adjecents to which Java counts aswell.

It was first named Mocha but later renamed to LiveScript and finally to JavaScript due to marketing reasons. To accomodate the Java trend during that time there was an interface between LiveScript and Java called LiveConnect. This connection was intented to be expressed with the new name "JavaScript".

Aurril
  • 2,469
  • 2
  • 24
  • 38
2

It's just a historical mistake. (and according to me there's no real valid reason to name JavaScript as JavaScript)

They have similar names because market was crazy about these new technologies when they were starting to come out (actually Netscape was about to include Java inside Netscape) and they accidentally chose to change LiveScript name to JavaScript. I wrote accidentally because they have nothing in common (apart from being two programming languages) so there's no a real, analytic reason for this similarity.

Jack
  • 131,802
  • 30
  • 241
  • 343
  • 5
    I plus this one because it's somehow correct and answering partially the OP's question, so I think -3 is not a fair votecast... Though in the form, choice of words, totally unsourced and very casual tone, it sounds more like an opinion than an information – cedbeu May 08 '16 at 05:05
-6

At the time Javascript or Livescript was launched into market the Sun MicroSystems was busy with the java creation so they named it as javascript. Also it uses some basic construts of the java.

sandeep manglani
  • 77
  • 1
  • 2
  • 6