I want to move from Java SE to Java EE. I will be using some of the sample projects that come with the Java EE. I have uninstalled the JDK but I think this may have been a mistake?
When I download the latest Java EE (6), upon installation it asks me for the location of the JDK (which is uninstalled). I was under the impression that the JDK was specific to each version of Java i.e. SE or EE. Am I wrong here? I would have thought that when I download Java EE 6 that it was actually the EE JDK?
Can anybody please clarify this for me?
Java EE is simply a set of APIs on top of Java SE. You'll need to re-install your Java SE JDK.
The JavaEE downloads from Sun's site are just the reference implementations. They build on top of the existing JDK. If you want to use the reference implementation, then go ahead... however, there are lots of other implementations instead.
If you're only doing web applications, you can get away with just a Servlet container.
Reference:
GlassFish v3 - Full JavaEE 6
GlassFish v3 Web Profile - Servlet-only JavaEE 6
Servlet-only:
Apache Tomcat - JavaEE 5
Jetty - JavaEE 5
Open Source Full:
Apache Geronimo - JavaEE 5
JBoss - JavaEE 5, partial 6
Commercial implementations:
IBM Websphere - JavaEE 5
Oracle Weblogic - JavaEE 5
No, Java EE builds on top of Java SE. To get started developing Java web applications, you can download Apache Tomcat.
Related
I would like to know if there is currently any compatibility problem between version 7/8 of VAADIN and tomcat 10
tl;dr
Tomcat 9 and 10 are essentially the same.
Only difference is javax.* package naming versus jakarta.*, respectively.
Currently for Vaadin, use Tomcat 9, not 10.
Ditto for competitors to Tomcat. Example: Use Jetty 10, not 11.
jakarta.*
Yes, there is one simple but big problem.
Vaadin is still coded to the javax.* package naming of the Java EE technologies on which it is built. This includes Servlet technology.
With Oracle transferring responsibility for Java EE technologies to the Eclipse Foundation, the naming of those technologies has changed from Java EE to Jakarta EE (Java™ being a trademark of Oracle). As part of that transition, the package names of the interfaces and classes defined in Jakarta EE technologies are changing from javax.* to jakarta.*.
This new package name is a breaking change for all the decades of software written for Java EE. While an unfortunate problem, the fix is utterly simple: Rename the package line at the top of all the source files.
The Jakarta EE project has done just that in version 9 of Jakarta EE. Most of the relevant technologies have had their individual version numbers incremented, but are otherwise substantially the same as their previous versions (renaming their package is the only significant change). See the 2020 newsletter from Eclipse Foundation, Understanding Jakarta EE 9 .
The Tomcat project now runs two parallel versions: 9 and 10.
Tomcat 9 uses the old package naming: javax.*
Tomcat 10 uses the new package naming: jakarta.*
Both are simultaneously being developed; 10 is not “better” than 9.
If starting a greenfield project, and you are using only libraries that have made the package name change, you may choose to use Tomcat 10.
If using libraries that have not yet made the package name change, use Tomcat 9. Vaadin is one such library still using the old package name.
➥ So, for now, your Vaadin projects should be run with version 9 of Tomcat rather than 10. No loss here, as Tomcat 9 and 10 are essentially the same.
There is no urgent need to make the javax.*-to-jakarta.* transition yet. Eventually, I expect we will see releases of Vaadin transition to the new package naming. There is talk of tooling to help with this change, both in the Vaadin camp as well as the wider Jakarta EE world, though I am not aware of their current status.
Of course, the other alternatives/competitors to Tomcat are going through the same transition pains. For example, Eclipse Jetty 11 uses the new package naming while Jetty 10 is in parallel development with an identical feature set, as explained in this post by WebTide. If using Jetty for your Vaadin development or deployment, you would be using Jetty 10 rather than 11.
Servlet 3.1
All versions of Vaadin today (2021-05) are built against the Servlet 3.1 specification, rather than Servlet 4 or Servlet 5. See the documentation page, Apache Tomcat Versions for a table of which Tomcat supports which Servlet spec.
So no need even for Tomcat 9 in that regard. Tomcat 8.5 supports Servlet 3.1, so it will suffice for current Vaadin apps. FYI, Tomcat 8.5 was originally forked from early Tomcat 9, and contains mostly the same features.
I have a Java application which shows Apache Tomcat Embed as 9.0.35 version. I need to update this to 10.0.4. I'm very new to Java and have very minimal knowledge on it. This upgrade is needed to resolve some vulnerabilities with in the application.
How can I do this from IntelliJ IDE?
Tomcat 9 & 10 are equivalent products
Apache Tomcat 9 and 10 are equivalent products. The only difference is support for changes for the package names in the Jakarta Servlet and related technologies from javax.* to jakarta.*.
This package name change is for legal reasons involved in the transfer of responsibility for Jakarta EE (formerly Java EE) technologies from Oracle Corp to the Eclipse Foundation.
For more info, read Understanding Jakarta EE 9.
To quote the documentation:
Users of Tomcat 10 onwards should be aware that, as a result of the move from Java EE to Jakarta EE as part of the transfer of Java EE to the Eclipse Foundation, the primary package for all implemented APIs has changed from javax.* to jakarta.*. This will almost certainly require code changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later. A migration tool is under development to aid this process.
Move to the latest 9 rather than 10
Tomcat 9 and 10 track the same development changes. If your goal is simply to gain some security fixes, as far as I know you'll get the same fixes in both 9 and 10. Do not take my word for this, just study the Tomcat Release Notes.
So for the fastest easiest migration path, just upgrade to the latest 9 instead of 10. The current latest version of 9 is 9.0.44.
Stick with Tomcat 10
Alternatively, if you want to proceed with using Tomcat 10, change the import statements across your code base to use jakarta.* in place of javax.*.
IDEs such as IntelliJ have added features to assist in this migration chore.
And you’ll need to update any third-party libraries using javax.* to new versions using jakarta.*.
This question already has answers here:
Servlet 5.0 JAR throws compile error on javax.servlet.* but Servlet 4.0 JAR does not
(3 answers)
Closed 1 year ago.
I am just trying to learn some JSP but I am getting that error repeatedly. I've tried everything on the internet and nothing happened. I am using the Tomcat v10 and JDK15.0.2. This error occurs when I create a new JSP file.
Java EE ⇝ Jakarta EE
Read the front page of downloading documentation for Apache Tomcat 10. To quote:
Users of Tomcat 10 onwards should be aware that, as a result of the move from Java EE to Jakarta EE as part of the transfer of Java EE to the Eclipse Foundation, the primary package for all implemented APIs has changed from javax.* to jakarta.*. This will almost certainly require code changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later.
And read the first page of the main documentation for Apache Tomcat 10. To quote:
Apache Tomcat version 10.0 implements the Servlet 5.0 and JavaServer Pages 3.0 specifications from Jakarta EE …
As part of Oracle turning over responsibility for what was known as Java EE (Enterprise Edition) to the Eclipse Foundation, the package names in Jakarta EE are changing from javax.* to jakarta.*. You can read about this on the Tomcat page, Which version? — Apache Tomcat Versions, and on the internet.
Tomcat 10 is for people moving forward to Jakarta EE versions 9 and later, using the jakarta.* namespace with the latest Servlet & JSP specs.
Tomcat 9 is for people sticking with the javax.* namespace using the popular Servlet 4 spec and related APIs.
If you want to use the latest APIs, change your import statements to use jakarta. rather than javax.. Or switch out your Tomcat 10 for Tomcat 9 to use the older javax. namespace.
If you are learning and experimenting, I suggest using the jakarta. namespace along with Tomcat 10.
If you are using important libraries or tools that are not yet updated to the jakarta. namespace, stick with the older APIs and Tomcat 9.
There has been talk of tools to help by automating some of this namespace switch. But I do not know of the state of affairs there.
You need an update from https://download.eclipse.org/releases/2021-03/ . Support for Apache Tomcat 10 and Jakarta EE JSPs is extremely new.
I suppose you could also just use Tomcat 9.
I am currently trying to find an application server where I could deploy my Java 8 projects. As far as I am aware, due to a bug in Glassfish 4.0 it is not possible to run any Java 8 projects on it, and Tomcat supports Java up to Java 1.7. Are there any other possibilities I am not aware of?
Wildfly 8 supports running on java 8's JRE (don't be confused by downloads page saying "Java EE7", this is about EE spec implemented).
in a tutorial they asked me to install the application server which could be downloaded from their site.
what do they mean with application server?
the link they provided: http://java.sun.com/javaee/downloads/index.jsp
i mean come on sun, all these names. jdk then j2ee..and when i wanna download j2se it says jdk6. r they insane? a lot of people are wondering what is what...they just dont know how to name things.
however, back to the question. so with application they mean java ee server?
i've got a mac and people say java is already installed. what is installed exactly? the j2ee or j2se? do i have do download j2ee? Java is just killing me...
EDIT: read something about that the application server is a name for ee server. and there are many ee servers like tomcat, jetty and glassfish. and i know these sometimes are called servlet containers.
so that makes application server = ee server = servlet container?
and jdk = j2se? so j2ee != jdk?
Sun's Application Server has been superseded by the community app server, GlassFish.
The JavaEE download page only has two JavaEE6 download links and both contain versions GlassFish v3. Chances are you only need the web profile, but download the full version if you aren't sure.
Note that GlassFish is just the reference Application Server. You also have other Application servers, such as Apache Geronimo and Oracle Weblogic... as well as ones that are just servlet containers, like Apache Tomcat and Jetty. These types should correspond to GlassFish's normal and web profiles respectively.
These other servers only require a JRE to run applications, or the JDK to develop for them.
Side Note: GlassFish v3 is the only JavaEE 6-compliant server... JavaEE 6 is brand new. The others should be JavaEE 5 compliant.
Also, JavaEE is the new name for J2EE, as sun tries to move away from the Java 2 name.
What do they mean with application server? The link they provided: http://java.sun.com/javaee/downloads/index.jsp
An application server is a component-based middleware used in server centric N-tier architecture. It manages the life-cycle of components deployed on it, it provides services for state maintenance, data access (with pooling of resources), security, clustering and fail-over.
AFAIK, one of the first application server (as just defined above) was ATG Dynamo. Other proprietary application servers include BroadVision, ColdFusion, etc. But none of them really survived to the advent of Java application servers (understand application servers based on the standards defined by Java EE and the Java language).
I mean come on sun, all these names. (...)
Wikipedia does a pretty good job at defining what Java SE is:
Java Platform, Standard Edition or Java SE is a widely used platform for programming in the Java language. It is the Java Platform used to deploy portable applications for general use. In practical terms, Java SE consists of a virtual machine, which must be used to run Java programs, together with a set of libraries (or "packages") needed to allow the use of file systems, networks, graphical interfaces, and so on, from within those programs.
The JRE (Java Runtime Environment) provides the virtual machine and the set of libraries i.e. everything you need to run Java software. The JDK (Java Development Kit) provides a JRE plus a compiler (javac) and some other tools i.e. everything you need to run and develop Java software.
Java EE is a specification (more precisely, a set of specifications) built on top of the libraries provided by Java SE and is more server-side oriented. Implementations of this specification are provided by Java application servers: GlassFish is Sun's implementation, JBoss is RedHat's implementation, WebLogic is BEA Oracle's implementation, WebSphere is IBM's implementation, etc.
Regarding the versions and nomenclature, yes, Sun is crazy. It was an horrible mistake to introduce this "Java 2 Platform, Standard Edition" naming when the version 1.2 came out. I can imagine how confusing this is. But, again, Wikipedia does a great job at clarifying this in the section Nomenclature, standards and specifications:
Java SE was known as Java 2 Platform, Standard Edition or J2SE from version 1.2 until version 1.5. The "SE" is used to distinguish the base platform from Java EE and Java ME. The "2" was originally intended to emphasize the major changes introduced in version 1.2, but was removed in version 1.6. The naming convention has been changed several times over the Java version history. (...)
This should make things more clear.
(...) however, back to the question. so with application server they mean java ee server?
Yes, this is what they mean or, more precisely, they mean Sun GlassFish Enterprise Server (previously named Sun Java System Application Server). Source: http://developers.sun.com/appserver/.
I've got a mac and people say java is already installed. what is installed exactly? the j2ee or j2se? do i have do download j2ee? Java is just killing me...
A JRE or a JDK (if javac available, it's a JDK), so only the Java SE part. And actually, if you are still following me, you don't download Java EE, you download something providing an implementation of it (i.e. an application server).
(...) so that makes application server = ee server = servlet container?
No. To simplify, a Java EE server = Servlet container + EJB Container. Some server are only Servlet container (like Tomcat, Jetty), they don't provide the EJB container part and thus don't fully implement the Java EE specification and can't be considered as full Java EE servers.
and jdk = j2se? so j2ee != jdk?
I hope I covered this with my answer.
In order to run you Java EE applications you need an application server.
The link you provided is to download GlassFish that is one application server.
There are others application servers like Apache Tomcat, Jboss.
JDK stands for Java Development Kit
You need this to develop Java applications.
JRE stands for Java Runtime Environment
You need this to run Java applications.
GlassFish with the Java EE SDK (provided on the link you gave) is what you need. Java EE server = application server.
What is installed on your Mac by default is probably only a JRE (runtime environment) and not a JDK (development kit). Which means, you can run Java apps but not develop. By downloading GlassFish with the Java EE SDK, you'll get the full-blown SDK you need and a server to deploy on.
Hope that helps.