Here is the information of our web development project.
Tool: Eclipse IDE for Java EE Developers (i.e. Java EE IDE)
Libraries:
- JRE System Library: zulu7.29.0.5-ca_jdk7.0.222-linux_x64 (JavaSE-1.7)
- Other (e.g. Hibernate3, JbossAS, Struts-Portal, etc): JbossIDE
Is our project using Java EE or Java SE? I need to introduce what Java version that we are applying for our project but I have no idea how to find and explain. What Java EE version that we are applying for our project if we are using Java EE?
"Java EE" (JEE) is a bunch of Java technologies regulated by specifications. JEE includes technologies like Enterprise JavaBeans, Java servlets, and JSP. If you're using any of these, you a probably "using JEE" in some sense.
However, "using JEE" isn't a particularly well-defined term. If my application uses servlets and runs on Tomcat than I'm probably "using JEE" to the extent that there is a JEE specification for servlets. But many people will use the term "using JEE" to mean, essentially, "running on a JEE-compliant application server".
I see "JBossAS" in the OP. I'm guessing that refers to JBoss Enterprise Application Platform (as it is now called). JBoss EAP is a JEE-compliant application server. If your application is hosted on EAP, it is probably a "JEE Application" in some sense. Different versions of EAP support different versions of the various applicable JEE specifications -- you'd have to look at the product documentation of your version to know which is appropriate in your case.
The only thing we can say for sure about your project's Java SE / EE version requirements is that it is being built to run on a Java SE 7 platform.
The IDE you are using doesn't tell us anything. (You can can use "Eclipse IDE for Java EE Developers" to develop plain Java SE code ... if you want.)
The other technologies are Java EE relevant ... bit it is hard to discern a minimum Java EE version requirement. Probably anything after Java EE 5 would be sufficient for Hibernate 3. However, you probably should check the specific versions of all of the EE relevant libraries that you use for their Java EE platform requirements.
Related
I am having a problem with Netbeans and when I tried to create a Java Web by following their instructions:
Choose File | New Project.
Under Categories, select Java Web.
Under Projects, select Web Application.
Click Next. Web Server-- Apache Tomcat 7.0.42
but Java EE version-is only EE6 and EE5. Why does it not Show EE7??
should i need to install any plugin?
I have the follwong installed:
JDK 1.7_upadte_42
Netbeans 7.3.1
Apache Tomcat 7.0.42
Tomcat is not a Java EE compliant application server to begin with, it is a servlet container1. It is clearly stated in the official site:
Apache Tomcat™ is an open source software implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies.
In order to use Java EE 7+ capabilities, you need to use a Java EE 7+ compliant server. Currently, AFAIK this is done by GlassFish 4 only. When you visit the official site, it is stated in the top: World's first Java EE 7 Application Server. Make sure you configure your project to use GlassFish 4 and then you may use Java EE 7 benefits for your applications.
Note that this is also covered in Netbeans 7.3.1 community news:
NetBeans IDE 7.3.1 is an update to NetBeans IDE 7.3 and includes the following highlights (emphasys mine):
Support for Java EE 7 development
Deployment to GlassFish 4 (not Tomcat)
Support for major Java EE 7 specifications: JSF 2.2, JPA 2.1, JAX-RS 2.0, WebSocket 1.0 and more
1 At least not until Tomcat 7. Looks like from Tomcat 8 it will support Java EE 7 profile (from the official site linked above):
The Apache Tomcat Project is proud to announce the next release candidate for Apache Tomcat 8 - 8.0.0-RC5 (alpha). Tomcat 8 is aligned with Java EE 7.
Short Answer: You need to use Tomcat 8+ for Java EE 7 web projects. Additionally (as mentioned), you may need to use a later version of NetBeans (7.4+) for full support.
Long Answer:
I'm a little late answering here, but I'm posting an answer for the record in case others see this question and to clear up misconceptions. Contrary to the prevailing belief, you can deploy Java EE apps to Tomcat.
There are two Java EE profiles relevant here: the "Full" profile (which includes the full Java EE stack) and the "Web" profile (a subset of the full profile which is designed to be implemented more easily by servlet containers). As mentioned, if you must use functionality only available in the full Java EE 7 profile you will need to deploy to an app server such as Glassfish 4+, [Jboss] Wildfly 8.1+, or JEUS 8.
However, Tomcat does comply with the Java EE Web profile, so you can deploy Java EE apps to it so long as you stick to just the functionality provided by the Web profile.* Often (if not usually) the web profile is all you need. The web project mentioned by the asker only uses stuff from the web profile. Tomcat 7 complies with the Java EE 6 Web profile and Tomcat 8 complies with the Java EE 7 Web profile, so the OP just needs to upgrade to Tomcat 8 if he wants to use EE 7.
* Oracle makes it easy to stick to one profile or another by distributing specific API jars for each profile ("javaee-api" for the full profile, "javaee-web-api" for the web profile, etc). That's the only dependency you need** to create Java EE apps, and you don't even have to (and shouldn't) bundle it in your WAR. In reality you may need to bundle (but not compile against) some libraries a la carte--or use the TomEE variant of Tomcat--to use all EE 7 web features.
** If you see gobbledygook about "endorsed dirs" and "endorsed APIs" in your build files, that's not a real dependency and is just to ensure that your code compiles against the correct class versions. For example, the standard (non-EE) Java 7 runtime already includes a version of JPA, but Java EE 7 includes a different version so the compiler needs to know which version to use. Don't take out that gobbledygook or you could (but probably won't) have runtime "class version incorrect" issues.
At the moment, Java EE 7 is only partially supported by Netbeans 7.3.1. They will support it in NB 8.0. Also, you need Tomcat 8 for Java EE 7, but their support is still partial too. Glassfish 4.0 is the way for now.
Here are some useful docs:
http://wiki.netbeans.org/JavaEE7
http://tomcat.apache.org/whichversion.html
http://docs.oracle.com/javaee/7/tutorial/doc/
I need help with Java SDKs. I have installed Java SE SDK, and I also installed Java EE SDK. However, where are the JARs in the Java EE SDK? Isn't Java EE SDK a superset of Java SE SDK? Do I need both?
It doesn't seem that I successfully manages to add all libraries in IntelliJ.
Java EE is an abstract API. The application server (e.g. Glassfish, JBoss AS, Tomcat, etc) is the concrete implementation. The Java EE download link on oracle.com contains the concrete reference implementation of the Java EE API, which happens to be Glassfish.
In order to develop against the Java EE API, you just need to reference the application server's libraries in the compile time classpath (the build path as it is called in most IDEs). I'm not sure about IntelliJ, but in Eclipse all you need to do is to integrate the application server runtime in the IDE's server configuration and then associate the web project with exactly that server runtime in the project's properties.
You do not need to explicitly add it to the JDK library, even more, it would possibly make things worse in the future as in losing portability and possible major classpath troubles. See also this related (Eclipse-targeted) question: How do I import the javax.servlet API in my Eclipse project?
Java EE is a set of additional APIs/interfaces (and most usually, some implementations of these). These are APIs for web applications, EJBs etc. You can use the JDK to build for this, provided you have the additional APIs and the implementations. Most usually a Java EE application will run in an application or web container.
Ref. Link JDK = Java SE && JDK != Java EE?
I do not have a clear idea what the main difference between JavaSE and JavaEE is!
I would like to know whether JavaSE is a subset of JavaEE or JavaEE is totally different from JavaSE. I also like to know whether JavaEE JDK includes all of the classes and API libraries included in JavaSE.
If I install JavaEE JDK on my PC can I then install NetBeans? What will be the advantages?
Java Platform, Enterprise Edition or Java EE is a widely used platform for server programming in the Java programming language. The Java platform (Enterprise Edition) differs from the Java Standard Edition Platform (Java SE) in that it adds libraries which provide functionality to deploy fault-tolerant, distributed, multi-tier Java software, based largely on modular components running on an application server.
In JavaEE you can develop enterprise level web applications using javaSE libraries.
In a way yeah, you can say JavaSE is a subset of JavaEE. It adds more libraries that make deployment and development of enterprise applications easier. So, it includes all the libraries and more that are part of JavaSE.
You can install javaEE SDK on your PC and install netbeans. It is also possible with just javaSE SDK. Java EE is more advantageous (more bulky) if you are developing enterprise apps(more scable, distributed etc..)
Please confirm the above statement?
I need to know what they are referring to when they mention JDK.
Java Development Kit is the way we usually refer to a set of tools to create Java applications, including the Java Compiler (to translate your JAVA Source classes into .class bytecode files), the Java Virtual Machine (to execute those .class files), the JAR tool to ZIP applications (or extract them) and so on.
The Java Standard Edition usually refers to the core classes that make up the foundation of most Java programs, such as the Collections API (List, Map, Set, etc.), the classes in the java.lang package, the I/O classes, the Threading API, the RMI packages and classes, the i18n (internationalization) classes, the JDBC API and, of course, the AWT and Swing classes to create desktop applications and applets. These APIs are the very foundation of all other programs you can write 'in Java', such as the IntelliJ IDEA IDE, Servlet Containers (like Tomcat), RDBMS (like Apache Derby) or custom standalone clients such as SQuirreL. These classes you get as part of the JDK (just crack-open the src.zip file right under your JDK folder and see what you find there :) )
Java EE is a specification with sub-specifications that, as a whole, define a set of services that implementations (such as GlassFish or IBM's WebSphere) should provide in order to be in compliance with the spec. These 'implementations' are the so-called Java EE Containers. When you hear people saying that 'GlassFish is a Java EE 1.6 implementation' they mean that GlassFish (a Java program written using the Java Standard Edition classes) provides all the features that the Java EE 6 family of specifications define.
The Java EE specifications are supposed to cover a particular need within the field of 'enterprise' application development, such as the Servlet specification for HTTP request-response processing, the EJB specification for transaction management and component life-cycle management, the JMS specification for messaging services and so on. The Java EE containers (WebLogic, WebSphere, Tomcat) provide actual implementations of these specifications as classes. In an overly simplified statement, these containers provide the JARs for the Java EE APIs. The classes within these JAR files make use of the Java SE core classes. I think this last sentence makes the connection between Java SE and Java EE.
To wrap this up, I would say that the JDK is just a set of programs you download and execute to create and execute your programs 'written in Java'. If you have a Java program that only makes use of the 'core classes' and requires no 'enterprise services' you execute your Java program on top of the JSE. Finally, if you need to provide some functionality and any of the Java EE specification's implementations cover any of your needs, say you need to process HTTP requests; you create a component as dictated by the spec (a Servlet in this case) and deploy it into your Java EE container -Tomcat, for example-.
Hope this helps
When you download the standard Java development kit, you get the standard edition of Java (Java SE) in a development form (JDK). The Java runtime (JRE) is the same set of libraries etc. without the development tools (compiler etc.)
Java EE is a set of additional APIs/interfaces (and most usually, some implementations of these). These are APIs for web applications, EJBs etc. You can use the JDK to build for this, provided you have the additional APIs and the implementations. Most usually a Java EE application will run in an application or web container.
Note (also) that until very recently, Java SE was known as J2SE, and Java EE was known as J2EE. The situation is confused further by the fact that many people (especially recruiters) confuse J2EE with EJBs (which are only one of the technologies in Java EE).
You're not alone in being confused by this. I regularly encounter experienced professionals who struggle with precisely what these mean, and Sun doesn't help by introducing Java 2 v1.6 (or is it Java 6?), and renaming J2EE to Java EE.
Using the definitions above, you will find a JDK for Java SE (a set of java features) and a JDK for the Java EE (the features in Java SE + some "enterprise" features).
The Java Standard Edition and Java Enterprise Edition are the definition and APIs of the Java language, and the JDK are the tools you need to develop something using those features.
To be more clear
Java SE -- Java Standard Edition, it happens to come in two versions: the JDK and JRE. JDK has the compiler and other tools.
Java EE -- Java Enterprise Edition is simply a standard, and a couple of libraries consisting mostly of just interfaces. While there are 'stand alone' components that can be downloaded for Java EE, alone they're of little value (again, being mostly just interfaces), and are typically bundled with the container you use to deploy or develop Java EE applications on. Plus Java EE comprises as an umbrella of many standards (JMS, JSF, etc. etc.).
In general JDK refers to the Java SE Development Kit. You can also see the abbreviation on the respective download page and not on the one for the Java EE Development Kit or the Java ME Development Kit.
JDK = java development kit.
Java SE = java standard edition (aka JRE)
Java EE = java enterprise edition (aka J2EE)
Update: Sun isn't well known for their clear naming conventions (Java 1.5 and Java 5.0 are the same thing, for example).
It boils down to this:
If you want to run java applications, go to http://www.java.com and click on the Download button.
If you want to write java applications, go to http://developer.sun.com and wade through it until you find a download that's about 80 MB called "JDK". There are several different versions of the JDK based on what kinds of stuff you're developing (web applications, console applications, etc.).
JDK = Java Development Kit
Java SE = Java Standard Edition
Java EE = Java Enterprise Edition
I am little confused about Java frameworks (I am coming from .NET). Do you need different server setups to run Java, J2EE and JSP? Does Java make a distinction in frameworks for enterprise and non-enterprise deployments? Beans? Struts?
Can someone make sense of this for me?
.NET has:
Windows development (Winforms, WPF)
web:
i) webforms
ii) mvc
These are the most commonly used terms that correspond to your "Java versions":
JRE: Java runtime environment, what's needed to run Java programs
JDK: Java development kit, a JRE plus compiler and some additional tools
Jave SE: Standard Edition, the API library that comes with every JRE and JDK for desktop use
Jave EE: Enterprise Edition, additional APIs that extend the J2SE for business use, meaning mainly server applications - this includes JSPs
Jave ME: Mobile Edition, a set of APIs (mainly a subset of J2SE) for mobile devices like phones
(The latter three are often also written as J2SE, J2EE and J2ME meaning "Java 2 ___ Edition" - Sun's naming and versioning convention are rather confusing)
Note that all of these are basically specifications, and there are implementations from different vendors. For example, you can get a J2SE 6 JDK not only from Sun, but also from IBM and Oracle.
There's a few different ways of looking at this.
Firstly, the only current version of Java is Java 6 currently at Update 17 or so. Java 5 and earlier have all been end-of-lifed. What's a little confusing is that starting at version 1.2 Java adopted the name "Java 2" (and was referred to as J2SE or "Java 2 Standard Edition") so it was Java 2 version 1.2. After Java 2 version 1.4 (or more simply Java 1.4). Version 1.5 became Java 5 or J5SE although J2SE is still pretty common.
The other version of Java that's relevant is Java Enterprise Edition ("Java EE"), formerly J2EE ("Java 2 Enterprise Edition") with version 6 being imminent. Java EE specifies a set of standards for server apps. The most important part is the servlets specification, which is the basis for 99.9% of Java Web frameworks. It has versions and is currently at either version 2.5 or 2.6 (I forget). Apache Tomcat is the reference implementation of the servlets specification.
Another part is EJB ("Enterprise Java Beans") currently at EJB3/3.1. It's a component architecture and really heavyweight. It's not used anywhere near as often as the base servlets specification.
Whereas Tomcat is a Web container, full Java EE supports is provided by what's called an application server. Examples include Glassfish, JBoss, Weblogic and Websphere.
Java classes are often packaged as JARs ("Java ARchives"), which is simply a zipped file with a specified directory structure.
Web applications are packaged as wars ("Web ARchive"), which is just a jar with a different extension. WARs may contain libraries in JAR form.
Full Java EE apps are packaged into EARs ("Enterprise ARchives"), which again is just a different file extension and it may contain war and other files.
Now to complicate this there are about a bazillion Java Web frameworks such as Struts, Spring MVC, Tapestry, Wicket and many, many others.
Also, it's fairly common for Java Web and enterprise apps to use the Spring framework. Spring is (imho) a must-have for Java serverside development as it simplifies a lot of vendor and library differences and makes your application far more pluggable.
Confused yet?
There are several versions of the JDK (1.4, 5, 6), much like there are several versions of .NET (1.1, 2.0, 3.0, 3.5). J2SE and J2EE are really just different packagings of the same version. J2EE includes some extra namespaces that aren't in J2SE.
From wikipedia:
Java Platform, Enterprise Edition or Java EE is a widely used platform for server programming in the Java programming language. The Java platform (Enterprise Edition) differs from the Java Standard Edition Platform (Java SE) in that it adds libraries which provide functionality to deploy fault-tolerant, distributed, multi-tier Java software, based largely on modular components running on an application server.
If you are going to implement a web application with Java, you can use Apache or Tomcat as a webserver.
To develop in Java, I suggest downloading NetBeans from here:
http://netbeans.org/downloads/
I prefer NetBeans than Eclipse because it is more similar to .NET's IDE, which basically means, it is more helpful.
With NetBeans, you can program every type of Java application, from a client java application, to a servlet, applet, etc...
There are 3 main Java platforms:
Java SE (standard edition)
Java ME (mobile edition)
Java EE (enterprise edition)
They all have the Java programming language in common, but differ in terms of APIs and libraries included in them.
From your question I'm guessing you're looking at Java EE?
Although it is possible to code an enterprise application in Java SE, Java EE is the natural choice because it takes care of many things you would face and allows you to focus on the interesting and useful parts of your application.
Java doesn't really distinguish from enterprise and nono-enterprise, in fact, you can use the APIs from Java SE in Java EE, and it's possible to use Java EE APIs in Java SE programs.
So what's the difference then?
Essentially, they are all platforms, execution environments. Java EE is more suited to developing big projects than Java SE, and as such includes various servers and things to help you code those big applications.
Beans, Servlets, Apache Tomcat server, Glassfish server all fall under the Java EE platform.
First you have the Java SE which contains the standard Java API. You can download it as JRE (only runtime) or as JDK (includes developer tools like java compiler).
Then you have the Java EE which contains the enterprise Java API. Java EE is in fact an abstract API (exist of almost only interfaces, abstract classes and API contracts). You need a concrete implementation to get a running Java EE platform. In case of JSP/Servlet you basically need a servlet container. Commonly used ones are Apache Tomcat and Sun Glassfish (which is bundled in Sun Java EE download).
You do NOT need to download the Java EE from Sun when you need Apache Tomcat. Just the Java SE is enough. The Sun Java EE download contains basically the Glassfish server and is also available as a bundle with Netbeans IDE (which I personally don't recommend for web development; Eclipse or IntelliJ are better choices for web development).
Let assume you would like to use Eclipse and Tomcat, then to get started with web development you basically need the following:
Java SE JDK 1.6
Apache Tomcat 6.0 (core, binary distributon)
Eclipse IDE for Java EE developers
jstl-1.2.jar (standard JSP taglib, use it instead of scriptlets!)
To kickoff with all:
Install Java SE.
Extract Tomcat zip and put it in desired location.
Extract Eclipse zip and run eclipse.exe.
In Eclipse's Servers view, add new Tomcat server and point to the Tomcat location.
In project explorer, create new Dynamic Web Project and pick the Tomcat from the list.
In the created project, drop the JSTL JAR in /WEB-INF/lib.
That should be it. You can create JSPs in /WebContent folder and create classes (servlet, filter, bean, domain, utility, etc) in src folder.
As to Struts, it has nothing to do with Sun. It's a component based MVC framework of Apache which is roughly said the competitor of Sun JSF. You can download it separately, put the libraries in WEB-INF/lib and use it in the project.
There is one JDK (only JDK 6 is supported today) and the Java Runtime Environment (JRE 6).
Typically you need only the JRE, but some frameworks need the tools.jar (i.e. javac) to run.
Even server and client modes can be detected and the Java EE libs come with the application server (or web server) you use.
Actually java has many other editions but normally we did not use that in applications ,
list given below :
JavaSE
JavaME
JavaEE
JavaFX
JavaCard
JavaDB
JavaTV
JavaEmbeded
and we can have 4 types of files in java :
Jar (Java archive)
War (Wep applications archive)
Ear (Enterprise application archive)
Rar (Resource adapter archive)
sorry for speling mistakes ,,,,