8

The Java Preferences application on my OS X Lion workstation indicates that I have Java SE 6 v1.6.0_29-b11-402 installed (both 32- and 64-bit versions). Unfortunately, I need additional features at are only available in the Enterprise Edition.

A comment by 'Jesper' in 'How install a specific jdk on Mac OS X?' suggests that I need to use the Java supplied by Apple, rather than the one from Oracle/Sun. Unfortunately, it doesn't seem that Apple offers an Enterprise Edition of Java 6.

This leads me to ask a number of questions:

  1. Did I miss something? Does Apple offer an EE of Java 6?
  2. If 1 is true, how do I get it? Can it be installed 'side by side' with the Java SE 6?
  3. If 1 is false, can a Oracle/Sun version be used? Is there a recommended installation location? I'm guess that the /System/Library/Frameworks/JavaVM.framework/Versions/ folder is not recommended.
  4. The Oracle/Sun version seems to include a lot of extras (e.g. Glassfish) that I would prefer not to install. Can I install the core SDK w/o the extras? Will Tomcat 7 work as an alternative to Glassfish?

** edit **

This question is a result of another question that I posted: RESTful web service: java.lang.NullPointerException service.AbstractFacade.findAll. It seems that this particular error is a result of a missing annotation (@Stateless). This annotation is 'contained' in the javax.ejb.* namespace, which is contained in a .JAR file that is not on my workstation.

This led me to conclude that I needed the 'Enterprise Edition' of Java 6 (which would have the missing .JAR file and other dependent files). I suppose if there was a way to determine which .JAR file is missing (Netbeans 7 doesn't seem to help with this) I probably could just add it to the project and skip the EE hassles.

Community
  • 1
  • 1
craig
  • 25,664
  • 27
  • 119
  • 205

3 Answers3

17

There is no such thing as a special runtime called Enterprise Edition of Java for any platform.

There is Java SE and there are simply some interfaces that an Enterprise Edition container implements.

Sun confused the market with the naming convention years ago when they came up with J2EE. It never was a separate version of Java, just some tacked on APIs that if a server implemented them and passed some certification, could call themselves a J2EE container.

They further confused the market when they started calling it Java EE 6.

If you are developing against these APIs all you need is the .jar files that contain these interface declarations. You can download these API .jar files which used to be called J2EE. But they are pretty useless by themselves.

But I doubt that you are wanting to write a Java EE server, you want to use one. If you want to use a server then you need to download a Java EE compliant server and use the .jar files it provides.

Every IDE worth using includes these in some form, usually by defining a Server that you will be deploying against. Tomcat isn't a fully EE container. It is a Servlet container, which is a subset of the full EE specifications.

As of OSX Lion, Apple doesn't supply a JDK anymore, it is only the Oracle one, which you apparently already successfully acquired.

Community
  • 1
  • 1
  • I don't understand. If there is no such thing as an Enterprise Edition, why does Oracle still use this terminology? http://www.oracle.com/technetwork/java/javaee/documentation/javaee6sdku3-relnotes-444316.html – craig Jan 15 '12 at 18:35
  • 4
    It's not like you download "Java EE" from somewhere. It's like you download some implementation (GlassFish, JBoss AS, WebSphere, WebLogic etc.) and develop againts this server. – Xorty Jan 15 '12 at 19:04
  • Actually, it's not *that* different for Java SE. You also wouldn't download Java SE, but would download an implementation. Only Oracle's implementation got so much market share that it became more or less synonymous with Java SE, but there was also a JRockit, a MJR, a Microsoft version (at one time the most famous one!) and there still is an IBM version, GCJ (which never really works though) and some other obscure implementations. OpenJDK is the most famous alternative, although the Oracle version is now directly based on this so also not really different. – Arjan Tijms Jan 16 '12 at 21:59
  • So, Apple *could* have offered an *implementation* of EE instead of SE (which is what it appears to have done before Lion)? – craig Jan 17 '12 at 02:40
  • 1
    Thanks, your edited answer is *much* clearer. On a personal note, I find anything related to Java's names horribly confusing (Oracle's influence?); maybe they should rename it Aspirin... – craig Jan 17 '12 at 02:56
  • I'm more confused after reading this answer. I don't see any instructions on installing Java EE as the OP requested. – Jason Jul 03 '12 at 20:04
5

Java EE 6 is a spec, with some accompany API represented as interfaces. Java EE 6 in and of itself is not an implementation of those APIs. If you wish to use the Java EE 6 APIs you will need to avail your self of a compatible Java EE Application Server. Glassfish is the reference implementation of Java EE 6, however there are other servers as well that are compliant. JBoss is another popular option.

These install easily on Mac OS X.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Will Hartung
  • 115,893
  • 19
  • 128
  • 203
0

There is a Java EE download. http://www.oracle.com/technetwork/java/javaee/downloads/index.html On its own though, its not particularly useful unless you're trying to develop an application that is intended to run in multiple containers.

What you will typically want to do is to download a container and develop with that. e.g. Glassfish (available at same link above). This task can be made easier with support from an IDE such as Netbeans. You can download a version of Netbeans that already includes Glassfish and the Java EE APIs and just start working. Other IDE/container combinations are possible, usually there is some sort of plugin available.

The Java 6 JDK/JRE for OSX is still from Apple. They transitioned most of the code to Oracle however, and the OSX version of JDK 7 is close to release status, and it may be mature enough for your purposes. My best guess is that it is.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
BillRobertson42
  • 12,602
  • 4
  • 40
  • 57
  • As of Lion which is clearly in the title, [Apple does not directly support a JDK anymore, it is provided, developed and maintained by Oracle.](http://stackoverflow.com/a/6765946/177800) –  Jan 15 '12 at 19:52
  • If you read the article linked to by the stack overflow question that you link to, you'll notice that it refers to Openjdk 7. Please check the first answer to the following SO question about how to download JDK6 for Lion http://stackoverflow.com/questions/6614380/jdk-on-osx-10-7-lion – BillRobertson42 Jan 15 '12 at 21:22
  • If you read the **ANSWER** that I linked to it is about how Java is being delivered in Lion. –  Jan 16 '12 at 15:51