Which Java EE server? - java

I'm moving in to developing Web Apps using Java EE and the first problem I have is not knowing which Server to use! There seems to be so many to chose from!
Glassfish server seems to stand out foremost (and it's top of the list) but when I try to start Glassfish 4.1.2, I get the error GlassFish requires Java SE version 6. and I can't download Java SE 6 for MacOSX without joining the "Oracle Club".
So which Server should I use??

You're running JDK 8, as you should. You should not be downloading JDK 6. It's long past the end of its support life.
Looks like the latest is version 5. You can download it here.
It should be said that you don't need Java EE to write Java web apps. Another alternative is Spring Boot. You won't need an app server, just an executable JAR to be run on a JDK.

Are you on OSX? You can get a JDK1.6 download here: https://support.apple.com/kb/DL1572?locale=en_US
I would be very careful with JDK1.6, it's about as safe as seatbelts made from toilet paper.

Related

How can i install Java 8 to Google Compute Engine (Debian 10)

First of all, I would like to say that I'm not a programmer and I am not experienced in the field. I was trying to set up a Minecraft server in the Google Compute Engine and I set it up successfuly. However, when I tried to switch it to a different version I could not open it because the server was running java 11. I removed it and tried a bunch of things to install Java 8 but I couldn't do it. Is there a way that i can reliably use to install java 8 to my server?
As you just pointed out, Debian 10's default and only officially supported java runtime is openjdk-11-jre.
Oracle provides their guide to download java on their website (https://java.com/en/download/help/linux_x64_install.html#download), which you can download, extract, and run.
I also found a nvidia-openjdk-8-jre package in the non-free repository of debian buster / bullseye. It exists for compatibility reasons and it's not recommendeded, but it might work.

New JDK for old java app

I have a rather old java web app, which uses servlet spec version 2.3. I use struts 1.0, jsf 1.0 there, etc. This app is running on tomcat 6.0.13. Java version in 1.7. But, I want to upgrade java there. May I install jdk 1.8+ there? I tried, but it began complaining on UI part incompatibility, etc. How to install in there?
After 4 days of running tomcat 6 and Java 8 I can say that there are 2 big issues which (thanks God) I have managed to fix.
Make sure all browsers which are using your web app has TLS enabled
Starting from certain update of JDK 7 java required TLS to be enabled in the browser, for example I had a trouble with clients which used IE6. The same is true for JDK8
Make sure you don't have any scriptlets in your application or they are compatible with java8
Tomcat compiles all your jsps to the special classes, and if you have in your code a construction like:
<% Set set=myHashMap.entrySet().blabla%>
you will get an exception which says that it can't understand the .class file structure, because tomcat is trying to use special framework (jasper?), which tries to parse the .class file of compiled jsp page. I moved scriptlets to the appropriate backing beans and it works ok. Please edit this answer if I was incorrect in tech description.

Researching for application server supporting Java 8

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).

Java EE and JDK

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.

sun's application server?

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.

Categories