This question already has answers here:
Java JDK, SDK, SE?
(4 answers)
Closed 5 months ago.
Me has been fighting with internet for a while for that single answer. Everything else now seems standing on it's place after this trip.
When I ask "What's Java SE" they say "Java SE is set of core Java classes ...... platform ... develop desktop apps .... contains core libraries and APIs ..... Java EE is a spec set to be implemented ...... Java EE is built on top of the Java EE". Sometimes they mention javac and JVM, sometimes they don't. What they do never (almost) is mention JDK.
When I ask "What's JDK" they say "JDK is set of stuff that lets us build apps on Java including javac, JVM etc." and never (almost) mention Java SE.
When I ask "Difference between Java SE and JDK" they give me that page and nothing more to think about. What does this mean: "Java SE product name for JDK"? Can't clearly understang right now.
Lack of terminology presicion and experiece for me? Possibly yes. I think would be able to answer this question myself if I were more experienced.
The questions:
"Whether (Java SE) == (JDK) or not?" (pls with wide explanation and terminology clarifications when needed).
Is Java SE a spec set like Java EE or not?
Can I find precise definitions somewhere to look at?
Sorry for a big writing. It proves that I would really love to put an end to this.
“Java SE” is three things:
An abbreviation of “Java Standard Edition”
A trademark owned by Oracle Corp.
A set of specifications published by Oracle Corp.
Anybody in the world is free to write software that implements the Java SE specifications. In the past, several companies have done so.
However, anybody in the world is not free to use the trademark of Java. To use that trademark, a person or company is required to come to terms with Oracle in a licensing deal. Presumably that deal would require payment.
Long story short, and over-simplified for brevity… Some of the companies that previously wrote their own implementations of Java SE decided to join forces, combine their codebases, and publish the whole thing as open-source. These companies included Oracle, IBM, and Apple. Thus was born the OpenJDK project (Wikipedia). Since then, other companies and individuals have joined the project.
The OpenJDK name is a trademark owned by Oracle. However, Oracle has published permission allowing others to use the term with no payment required.
The OpenJDK project published source code to an implementation of the Java SE specifications. The project does not publish built binaries or installers.
Several vendors do publish built binaries or installers for implementations of the Java SE specs. Nearly all of these implementations rely largely, if not entirely, in the OpenJDK source code.
These binaries/installers vendors include, in no particular order:
Azul Systems
SAP
Amazon
Microsoft
IBM
Red Hat
Oracle
Adoptium
BellSoft
… and more.
Most of those built binary or installers products use OpenJDK in their name or in their descriptions, as allowed by Oracle. A few of those products may use the term Java or Java SE with explicit permission from Oracle.
There are other editions of Java technology:
Java Card (for smart cards, badges, etc.)
Java ME, or Micro Edition (for constrained devices)
Java EE, or Enterprise Edition (a wide collection of specifications that run on top of an implementation of the Java SE specs, aimed at developers making software for enterprise oriented users)
The first two, Java Card & Java ME are owned by Oracle. The third, Java EE, was donated by Oracle Corp to the Eclipse Foundation were it is now known as Jakarta EE. Jakarta EE is a collection of specifications, with various vendors publishing implementations.
The term “JDK” refers to Java Development Kit. This kit includes an implementation of the Java SE specs, plus tools to write Java apps. These tools include a compiler.
The term “JRE” refers to Java Runtime Environment. This is a JDK minus some of the software development tools.
The term “JVM” refers to Java Virtual Machine. A JVM is a piece of software that enables a Java-based app to execute at runtime on a particular kind of host computer and operating system. Java apps are platform-agnostic, in other words, are not “native”. So a Java app needs a particular JVM to know how to run on a Mac, on a PC, or on a mainframe.
Every JDK and every JRE contains a JVM.
1 . Yes, you can think of Java SE same as JDK.
Java SE is the 'base' platform that defines the Java language specification (JLS), the Java Virtual Machine Specification (JVMS), Standard library APIs, byte-code format, compilation tools, and the class loader.
Now, this is all concepts and specifications and community proposals (via JCP) until implemented into a set of software tools. The set of software and tools that implements all of the above is called JDK.
JDK is essentially a Software Development Kit (SDK). They simply decided to name it JDK.
2 . Yes, Java SE is basically a set of specs. An implementation must follow the spec and get it reviewed & approved by Oracle before they can call their implementation Java.
In the case of Java EE the specifications deal with libraries & APIs most of the time. In case of Java SE the specs also care about language and VM details. You take Java SE (the standard JDK) + add some libraries and now you have Java EE. Oracle refers to this as Java EE SDK though.
3 . Unless your life depends on it. Just understand the relationship between Java SE, Java EE, JDK, SDK, and you are good. Just connect the dots and be done with it.
I think your confusion stems from what Java is. Originally, most languages were like C, where you write code, and it gets compiled to a specific computer architecture/ISA (x86, ARM, whatever).
Java "changed the game" when it came on the market, because it was:
Free (many langs at the time were proprietary)
Enforced object oriented programming style (which all the cool kids were doing at the time)
It added the JVM. The JVM is installed on top of the ISA, it was a piece of middleware that meant that compiled Java code could "run anywhere" (in practice, this isn't strictly true, but it's aside the point)
Anyways, if you just need to run Java programs, you can just install the JVM/JRE (of which the JVM is a component). If you actually need to develop Java programs, you need one of these "editions," which supports more or less features, depending on what you are doing with it. If you're a hobbyist programmer, SE is fine. SE, EE, and ME all include the JRE, JVM and JDK.
For a start here is the language specification (what's the meaning of for) itself and the JVM (Java Virtual Machine) specification. A JVM knows how to execute the code in the end. (see https://docs.oracle.com/javase/specs/)
"Java SE" is the "Standard Edition" as opposed to "Java EE" which is the "Enterprise Edition"
Enterprises create webservers so Java EE specifies many things needed for running Java based Webservers like how to respond to web requests. There also additional libraries and webservers that adhere to that Java EE spec but they are still written in Java, i.e. what you do with plain Java (SE). See https://www.oracle.com/java/technologies/javaee-8-sdk-downloads.html
To run any kind of Java program you you'll need a JRE (Java Runtime Environment) which is in a way part of Java SE because it bundles all the core functionality of Java. The core libraries (like the implementation of the String class) as well as a JVM implementation (Oracle, OpenJDK, ...). Even an EE webserver would still require a JRE to run.
If you want to develop a Java program, you will also need a JDK (Java Development Kit) which is essentially a JRE plus extra tools, the compiler for example. The compiler takes .java files and create .class files which is what the JVM needs.
It's also in a way part JavaSE but I wouldn't says JavaSE = JDK.
Java SE and just "Java" is probably the same, the other terms all go into different aspects of Java.
Related
I'm trying to understand the differences between Java SE and EE. There is a lot of information out there but from my current limited understanding, it seems like Java EE is just Java SE with some stuff added on top of it. Why can't I just use Java SE and import API or packages when I need them? For example if I need to be able to connect to a database I can import the JDBC API, is doing that any different that using JDBC in Java EE?
... it seems like JAVA EE is just JAVA SE with some stuff added on top of it.
That is incorrect.
In reality, Java EE is a specification, and a set of libraries that provide API interfaces to program against. What Java EE per se does NOT provide is the implementations of those interfaces.
A Java EE implementation is embodied in code that has been written by Java EE vendor. That implementation may or may not be a product that you have to pay for.
The other thing is that Java SE is not a part of Java EE. Not in any sense. Java EE APIs (and implementations) depend on a JVM and a Java SE class library, but they are separate things, and they are typically distributed separately.
Why can't I just use JAVA SE and import API or packages when I need them?
Assuming that you have downloaded the Java EE API JAR files (or your build tool has done it for you), you can compile your code against the Java EE APIs.
But you can't >>run<< your code on a plain Java SE platform because neither Java SE or the Java EE API JARs contain the classes that implements the Java EE APIs; i.e. the servlet framework, etcetera.
If you try a Java EE app without the vendor-provided code, it won't work. (If you don't believe me / us, try it for yourself.)
For example if I need to be able to connect to a database I can import the JDBC api, is doing that any different that using JDBC in JAVA EE?
JDBC used to be a Java EE API, but now it is a Java SE API. (Check the Java SE API documentation!)
But here's the thing. If you want to connect to a database using JDBC, your application needs to use database specific JDBC drivers ... which you get from the database vendor. (Just like you get a Java EE implementation from a Java EE vendor!)
Why can't I just import libraries into Java SE instead of paying for Java EE?
Most of this has been addressed above. But you also mentioned "pay for".
The reason you need to pay is because Java EE implementations are typically proprietary products. A company invested a lot of money in developing their codebase, and they want to make a return on that investment.
And indeed, from Java 9 onwards, Oracle Java SE is not free either ... for most use-cases.
In either case, there are three alternatives if you really don't want to pay:
Find a free (e.g. open source) implementation. They exist for Java SE and Java EE.
Develop your own implementation of the relevant specs. (That will be more expensive in terms of time than paying a vendor.)
Use the product without paying the required license fee, and hope that you don't get sued for a lot of money copyright violation, etcetera.
Isn't Java platform independent?
The Java programming language is platform independent.
The Java SE APIs are platform independent (more or less).
A Java SE implementation is NOT platform independent. If you download Java SE for Windows and try to run it on Linux, it won't work. (Never has, never will).
The "write once, run everywhere" mantra assumes that you have installed a Java SE implementation of the appropriate version on the platform. It doesn't imply that such an implementation exists, or that it will be available for free, or that it will be installed everywhere.
What "write once, run everywhere" mantra is actually saying is that you don't have to modify your Java application in order to make it run on another Java platform. (And note that there a number of caveats on the nature of the application for WORE. For example, it mustn't depend on native libraries or external applications that may or may not be present.)
Can't I import the Java EE library, get java.servlet.Servlet, program with it, the host my application server on any computer that has a connection to the internet and a static Ip address?
In two words: You can't.
No matter how many times or how many different ways you ask.
The Java EE libraries you mean only define interfaces. you don't need to pay for them. But you need an implementation of this interfaces. For instance, you can import Java EE library and you will get java.servlet.Servlet. But will have no implementation of this class.
To run a Java EE application you need a platform that, simple said, implements all these interfaces. Such platforms are so called so called Java EE runtimes or application servers like WildFly or WebSphere.
I've got a little question (just for a cultural purpose).
Would it be possible to download and install Java but not the standard edition ?
I know that Java SE contains basic and usefull functions / librairies (such as input /output).
Installing java without the "SE" is maybe useless and without any interest, but is it possible? if yes how ?
Many thanks,
Installing java without the "SE" is maybe useless and without any interest, but is it possible?
It is not possible. Oracle don't distribute a form of Java without libraries.
In fact, there is no such thing as Java without the libraries (SE or ME). The libraries are part of Java(tm) platform. If you managed to create something with the Java language and a JVM, but with partial, missing or incompatible libraries you couldn't call it Java1. Oracle owns the Java trademark, and they dictate the terms under which you are allowed to use it. If you used "Java" for a JVM / Library combination that doesn't pass the standard Java compatibility tests, you would likely get a "cease and desist" letter from Oracle's lawyers!
But more importantly, there is a significant subset of the Java SE runtime libraries that are essential for bootstrapping a JVM. If you were to build your own (ahem) Java build that left out critical classes, your JVM wouldn't work.
(And you cannot just simply2 write your own replacement for the Java SE library subset that the JVM depends on. There are many places where the C / C++ codebase for the OpenJDK JVM has intimate knowledge of the implementation details of the Java libraries. Figuring it all out ... from scratch ... would be challenging.)
Having said that, in Java 9 they introduced a tool called jlink which will produce a cut-down Java SE runtime for an application that only contains the libraries that are required by the application. Your can read about it here.
1 - For example, the Sun vs Microsoft lawsuit over Microsoft's attempt to "embrace and extend" Java 1.1. See What does Sun's lawsuit against Microsoft mean for Java developers?
2 - It's not impossible. Just a lot of really hard work.
The java command is traditionally from a SE installation. Typically in the JRE form, but occasionally I the JDK variation for advanced users. Others exist but are not for desktop usage.
So in that view you cannot install java without SE.
(note: Java EE is not a distribution as such but an API typically provides by big web servers)
Can I install Java but not Java SE?
Install? No. Not from any "official" distributions provided by Oracle, at least.
Why not?
Because Oracle doesn't package it that way. They offer 1) a Java SE development kit (JDK) which lets you create Java programs for yourself, or 2) a Java SE JRE which just lets you run Java programs that someone else created. There is no 3) Java without SE.
But couldn't they have given us option #3?
Could they have? Probably. Well, OK, maybe. Did they? No.
But theoretically it's possible, right?
Theoretically, I don't see why not. Theoretically, it ought to be possible to come up with a "Java" that's little more than a virtual machine and a compiler. Then, theoretically, using only this non-Java-SE Java language, you could either replicate the Java SE environment or develop an entirely new Java-based development platform.
I somehow understand the differences between Oracle JDK and Open JDK.
But I can't find reasons to use Open JDK.
Because Oracle JDK already has everything one would need and sometimes faster than Open JDK.
In which cases should someone use Open JDK?
Is it just for legality issues?
If yes, then what are issues?
That because I have been still develop all my projects using Oracle JDK
Other Answers are correct. Here is some other information as well, including vital changes as of early 2021.
Source-code versus Binaries/installers
understand the differences between Oracle JDK and Open JDK.
To sum it up: source-code versus binaries/installers.
OpenJDK is an open-source project, implementing the Java Specifications, JSRs, and JEPs that define the Java platform. This project publishes only source-code, not binaries or installers to get Java running on your computer (except for some early-access builds). Oracle is the principal participant in the OpenJDK project, alongside IBM & Red Hat, Apple, SAP, Azul Systems, Microsoft, and others.
Many companies provide distributions of OpenJDK for installation, as binaries or installers. Oracle is one such company.
Oracle actually provides two such products:
Oracle JDKA commercial product, with paid support plans. (Free-of-cost only for development & testing, not deployment. Read their terms.)
jdk.java.netA build of the OpenJDK source-code, freely available, unsupported.
Oracle has declared their intention to keep their commercial product Oracle JDK at feature-parity with OpenJDK. Oracle even went so far as to open-source and make available at no cost their formerly commercial tools Mission Control and Flight Recorder, both now a part of OpenJDK. So there is nearly no practical difference. One significant difference is that the Oracle company reserves the right to rapidly supply their paid support customer base with urgent patches not currently found in OpenJDK. Ditto for other vendors selling support.
[And for the record, Oracle offers a third implementation of Java, GraalVM, which is a very specialized product.]
Here is a flowchart graphic I made to help guide you in selecting a provider of a Java implementation.
And here is a list of motivations you might consider in choosing a distribution.
November 2017: At the time this question was asked, the reasons for choosing between OpenJDK and Oracle JDK include:
Availability of builds / installers for specific platforms. For example, last time I checked there were no Oracle JDK distros in ".deb" format for Debian / Ubuntu. And no OpenJDK builds for Windows.
Oracle JDK has some commercial features that can be enabled by people who have paid. They are not present on OpenJDK.
Oracle JDK has an annoying click-through license. This is a pain if you are trying to automate deployment; e.g. to cloud VMs. By contrast, OpenJDK on Linux (at least) can be installed and updated using the platform's package manager.
There may be issues if you wanted commercial support for OpenJDK.
There were no substantive license differences between Oracle JDK and OpenJDK if you just plan to use the software. (There are some constraints on binary redistribution for Oracle JDK, but they are about shipping non-standard or stripped-down versions of the Java platform.)
In the future, some of these differences will go away, according to this blog page:
Faster and Easier Use and Redistribution of Java SE
Update in December 2018:
As of January 2019, Oracle JDK Java 8 will be EOL for commercial uses. (But free support will continue until January 2020 for personal use.)
1
Java 9 and Java 10 are EOL.
Commercial uses of Oracle JDK Java 11 and later require a support contract or a subscription from Oracle. OpenJDK Java builds do not have this requirement.
Oracle do not provide support for OpenJDK Java builds, but support is available from 3rd parties. Third parties will also port Oracle security fixes to OpenJDK builds.
Further reading:
Java Is Still Free
OpenJDK Life Cycle and Support Policy (RedHat)
The future of Java and OpenJDK updates without Oracle support
What has changed in Java Release and Update Availability? (Azul Systems)
AdoptOpenJDK Support
1
EOL stands for end-of-life.
An end-of-life (EOL) product is a product that does not receive continuing support, either because existing marketing, support and other processes are terminated, or it is at the end of its useful life.
OpenJDK comes tightly integrated with the distribution update process. For example, on Fedora, this means that you simply can run
dnf update
without activating third-party repositories, and you will get the latest OpenJDK version with all relevant fixes.
OpenJDK is tested by the distribution vendor on this particular distribution. Oracle has different reference platforms for testing of OpenJDK. In the case of Fedora, software written in Java is tested with the OpenJDK version provided by the distribution, while the combination of that software with Oracle JDK receives much less testing.
Oracle also bundles their Java downloads with additional software such as browser toolbars, performance measurement and monitoring tools.
For those, who read this in 2019.
Java SE 8 is the last Java SE release targeting Desktop deployment (eg, Java Web Start and a stand-alone system JRE). Java SE 8 will be end of public updates in January 2019, after which commercial users need to either transition to other technologies, or purchase a Java SE Subscription.
So, another reason to use OpenJDK (in addition to what Stephen C said): it's free of charge for all purposes.
Java is the language, the JRE is the runtime environment, and the JDK are the development tools? The JLS is the spec that says that the JRE must do x,y,z, and therefore makes Java what it is? Are these views correct, and if not can someone enlighten me?
Are there any things we think are Java but are not? I think I heard that about Android -- is it true?
To some extent this is a problem of the ambiguity of natural language; some of these things can mean different things at different times.
"Java" can refer to the Java language, as in "I wrote this amazing FooWidget in Java." It can also be shorthand for the Java platform including the language, runtime, tools, etc., as in "You'll need Java to use this web application."
JRE stands for Java Runtime Environment and is the bundled set of APIs included with the Java Virtual Machine. The JDK, or Java Development Kit, is the set of developer tools including the Java compiler, debugger, javadoc compiler, etc. Confusingly, it also includes a JRE (as seen in Eclipse, for example, where the JDK can be specified as the runtime for a project).
The Java Language Specification (JLS) is, um, the spec for the Java Language. Put another way, it describes the technical details of how the language is implemented.
Android is a platform in which the code is written in Java, but compiled to run on the Dalvik virtual machine rather than the JVM. In that sense, it isn't actually Java, but from the perspective of the developer the difference is mostly library use; the syntax is the same.
Similar questions:
JDK/JRE/JVM/Java SDK | What do they
all mean? Sometimes you can develop
with JRE and sometimes you need
JDK?
What does the JRE consist
of ?
Java specification
for a project that targets embedded systems (such as a NAS) I am looking for an embedded Java VM that would support Java 5 and up. Currently, Java 1.4 is supported by VM like IBM's J9. But since Java 1.4 has reached its end-of-life I would be interested whether there are alternatives available, open source or commercially.
Any idea would help. Thanks.
Yes, as can be seen on Sun's Java Embeded downloads page: Java SE for Embedded Downloads. The blurb:
Sun offers Java SE for Embedded
products in both binary and source
offerings under an innovative
licensing model. Development is free,
but royalties are required upon
deployment on other than general
purpose systems (for details see
license). Platforms available for
embedded use include not only standard
Java SE platforms but also platforms
that are exclusive for the embedded
market. In all cases, the products
offered are fully Java SE compliant --
which enables you to reuse any Java
code from other platforms or products
without having to go through porting,
recoding and test cycles.