Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Installing J2EE problem

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Please forgive me if this is a really basic question, but I am confused - I studied Java a few years ago, understand all the syntax and concepts, but I never worked on the EE side before, and now I want to study this.

I want to install Java 7 SE and Java 7 EE.

Now I can go to Oracle's site and download a Java 7 SDK, and install it, which I have already done in my Windows 8.1 machine.

Where I am confused is how to install the J2EE bit.

My understanding is that J2EE contains additional packages like jsps and servlets, and when you install Java SE, these aren't installed as they're part of EE and not SE. Is this correct? So I went to Oracle's site, and downloaded java_ee_sdk_7u1. But unlike SE, this doesn't have an executable to run. it just contains a directory called glassfish, and I cannot see any jars that might contain the J2EE APIs like servlets.

I would appreciate some assistance.

Thanks!
 
Marshal
Posts: 78428
374
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

You should find all the downloads here; there are installation instructions links against each download button. I notice there is also a tutorial if you scroll down; you might do well to download that too. You must install JavaSE first.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you use Java EE, you create components such as servlets, JSPs (Java Server Pages) and EJBs (Enterprise Java Beans) that are not standalone programs. They are components that you deploy in a Java EE application server - a server program that provides things like an HTTP server, etc. and that can delegate HTTP requests to your servlets, and many other kinds of services.

Java EE defines all the types of components, and defines what services a Java EE application server should provide.

Glassfish is the Java EE application server reference implementation - it is the official Java EE application server example. Other companies have also implemented the Java EE standards and have their own Java EE app server implementation. There are a number of commercial Java EE app servers, such as Oracle WebLogic and IBM WebSphere, and there are free and open source app servers such as WildFly (formerly known as JBoss).

Oracle's Java EE SDK includes the Glassfish Java EE application server.

The Glassfish directory somewhere contains the JAR files with the servlet API and other Java EE APIs.

Oracle has an extensive Java EE tutorial.
 
Ranch Hand
Posts: 146
2
Mac Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What that means in relation to your IDE (I'm assuming you are using an IDE) and the glassfish directory is that you need to point your IDE to this directory when configuring the server in the IDE settings. Then, when you run the application, oula (fingers crossed).
 
John Smithonian
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all - so it seems to me that the J2EE classes are bundled into a J2EE application server, and that we don't really need to download them directly i.e. if we download Weblogic, then that will contain the J2EE classes already.

Yes, I will use Eclipse, I am actually getting started on J2EE by watching some webinars, the one I am watching uses Apache Tomcat, I would like to use Weblogic developer version. My question now is that Weblogic 10.3 seems to come bundled with the Java 6 EE classes, so I am assuming that I will need to use Java 6 SE?

Thanks.
 
Ashley Bye
Ranch Hand
Posts: 146
2
Mac Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This confused me when I first started looking into EE. The Java platform is modular, so you layer one component on top of another, so you can use all features in the lower parts of the stack. You should be able to specify which version of the JDK you want to use. The JEE stack sits on top of the JDK, therefore you can use the features of the JDK independent to EE facets when writing your program. For example, it is possible to use Lambda expressions (which are new to JSE8) within a Session Bean running on a JEE7 Application Server.
 
Sheriff
Posts: 67732
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You will need to use the version of Java and JEE that your application server supports. Why would you use something creaky like Weblogic rather than something more modern like Tomcat or Glassfish?
 
Ashley Bye
Ranch Hand
Posts: 146
2
Mac Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought you could use 8 and 7 together irrespective. Clearly that is not necessarily the case.
 
Bear Bibeault
Sheriff
Posts: 67732
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you mean by that.
 
Saloon Keeper
Posts: 27263
193
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing that can be confusing is that you don't actually need to download and install "J2EE" or "Java EE".

Everything you need you can usually find in whatever appserver you are working with. So, for example, when I use Eclipse to develop webapps for Tomcat, I add the TOMCAT_HOME/lib/servlet-api.jar and jsp-api.jar files to my project's compile path (DO NOT include the jar into the WAR you are building!). Too avoid making my projects tied to my specific filesystem, I use the Eclipse "symbolic variable" mapping feature that allows me to tell Eclipse itself where those JARs are and only reference them by a (portable) symbolc name in my projects.

This is also true for other webapp servers such as WebLogic.
 
John Smithonian
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, a lot of useful answers. The reason I want to use Weblogic and not Tomcat is we use Weblogic at work, and so I want to get some hands-on admin practise of that too.

Ok, so it seems that we should use the same SE version as the EE version. So now my question is this, Weblogic 10.3 says: This version of WLS requires JDK 1.6. For Mac use 1.6.0_20 latest update. Ensure that you have the proper JDK version installed.

But on the Oracle website, they say we strongly recommend you to not use an older SDK because of security risks. This confuses me - say some enterprise has Weblogic 10.3 running and they haven't upgraded, they must be using Java 1.6, if Oracle isn't updating the older versions with the latest security patches, then these enterprises are at risk, yes? Does this mean enterprises are forced to upgrade their Java application servers constantly?

Thanks.

 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Smithonian wrote:Ok, so it seems that we should use the same SE version as the EE version.


The version numbers of Java SE and EE are independent, and don't align. So, if you are using Java SE 7, it does not mean you need Java EE 7. Look at the specs of your version of your app server which Java SE version is required and which version of the Java EE specification it supports.

WebLogic version 10.3 is already old (from 2008, according to Wikipedia). In the Wikipedia article there's also a table that shows what versions of WebLogic support what versions of Java SE and EE. For WebLogic 10.3 is says Java SE 6 and Java EE 5.

John Smithonian wrote:This confuses me - say some enterprise has Weblogic 10.3 running and they haven't upgraded, they must be using Java 1.6, if Oracle isn't updating the older versions with the latest security patches, then these enterprises are at risk, yes? Does this mean enterprises are forced to upgrade their Java application servers constantly?


Normally, new Java versions are compatible with older versions, and software written for Java 6 should run without any problems on Java 7 or 8. But there can always be small incompatibilities, so they won't promise you that WebLogic 10.3 works correctly on Java 7 or 8.

Enterprises normally don't upgrade all their systems immediately whenever a new version of some piece of software is released. Testing your software with the new version, upgrading servers, having employees learn a new version etc. all takes time and money and involves risk, so enterprises normally only do that when they have a business case to do so. You are seeing this in your own company, which is currently using versions of Java and WebLogic that are two versions behind the latest.
 
John Smithonian
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great, many thanks - I more or less have the answer to my question now.
 
Campbell Ritchie
Marshal
Posts: 78428
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tell us when it is actually working
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic