Reputation: 29468
The question may at first sound silly, but maybe it isn't at all.
Java is not the Java language, most people know that, since you can program Java with lots of other langauges like Scala or Groovy
Java is not a concrete VM implementation since there are other implementation out there, not only SUN's, Microsoft's or IBM's.
Java is not the class framework since many implementation add or leave out classes at will.
It isn't even that a common VM specification or even Java bytecode must be used, see Dalvik VM
Maybe it is just a set of principles they share, whatever this may be. It definitely is not "Write once, run everywhere" since this isn't the case for at least Dalvik and Microsoft VM/J#.
So the question is, what exactly is Java? Is there even an exact definition?
EDIT Lots of people seem to have the opinion that java only means the programming language. So a java-enabled mobile phone must be a phone which enables the user to use programs consisting of class files created with the java language only. If this would be true, the java virtual machine / java runtime environment / java development kit would be made for java only and other jvm languages would have their own corresponding xvm / xre / xdk.
Upvotes: 13
Views: 1256
Reputation: 1977
You cannot say that Scala is Java any more than you can say that a fork is a comb just because you happen to be brushing your hair with it. Or, if I may bring up the classic analogy, driving nails with your wrench doesn't make it a hammer.
You can make a compiler that compiles COBOL into C++ if you want, but that doesn't mean COBOL is C++.
Many languages have x86 machine code as their target compiled language, so does this mean they are all the same thing?
It doesn't matter if other languages can compile to the JVM's bytecode, nor does it matter that you can compile Java into a specific architecture's machine code. The JVM is still Java's platform; other languages just happen to share it, and Java just happens to be able to compile to targets other than JVM bytecode. The same way as a fork just happens to be able to comb your hair depending on how you handle it.
I think this is a silly question (and has nothing to do with programming besides). Is it possible for someone to act like a renaissance philosopher and try to argue that your fork is actually a comb because you have never, ever used it as a fork and always use it only in your hair? Sure, go ahead and argue, and maybe you'll even have a point, but hopefully nobody wastes their time listening to it. This is all just a game of semantics, and once you start arguing about semantics everybody loses.
(edit) Bah! I just realized I'm arguing about semantics!
Upvotes: 2
Reputation: 13819
Strictly speaking Java is just a programming language. But it's a programming language that includes many, many standards: for example many API’s and JVM specifications. That's why SUN and others refer to it as a platform.
Other languages like Scala, Ruby, etc. are not Java, they just compile to byte code that runs in a Java Virtual Machine. They are just build on top of the Java platform, but are themselves not Java.
The JVM is highly standardized and many companies can and do offer their own implementations for their hardware platforms. This is not Java either, these are just implementations of a part of the Java platform.
The Java VM specification is 100% standardized something that is enforced by Oracle as they claim copyright on Java. That’s why the Android (Dalvik VM) is currently the subject of a court case of Oracle against Google.
Upvotes: 5
Reputation: 26796
Actually, it depends on the context where the word is used. It's all: syntax, technology, framework, programming language.
As a sidenote, Oracle answers this question as follows: What is Java?
Upvotes: 3
Reputation: 3305
Most people see Java as the programming language (as defined by the Java Language Specification). But there are plenty of others who split it into the Programming Language, the various VMs and the larger ecosystem.
There are also legal definitions of what can be called Java (e.g. The trademark), but I think I'm going to leave that one alone at the moment :-)
Upvotes: 1
Reputation: 103777
Java is the Java language, actually. Groovy, Scala et al compile down to equivalent bytecode that can run on the JVM, but they aren't Java.
Formally, I'd say that Java is the JLS.
Upvotes: 39
Reputation: 18743
In my opinion it's the language. I don't think people say they're programming Java with Groovy, or if they do, they are being inaccurate.
Upvotes: 5