Doesnt JAVA EE SDK include the APIs in JAVA EE DOC? - java

I installed JAVA SE JDK and then installed JAVA EE SDK java_ee_sdk-6u4-jdk7-windows-x64.exe
because the latter one requires a jre. But then I found that the java ee sdk is merely nothing new than java se but a combination of java se jdk+ glassfish platform. I do not know if I am right because I cannot find those "java ee" classes in it. (And the .jar files in jre/lib are the same) It is strange. Lets say JavaMail package, I cannot find it in my java ee jre but it is said this package is included in Java ee platform.
What I expected is the new apis and "java ee" source code which I could not find either. I really would like to know how to get a jdk which includes all the apis descripted at
http://docs.oracle.com/javaee/6/api/
Can some one tell me if I am right about this issue (JAVA EE SDK does not contain JAVA EE API)? If I am right, do I need to get each jar lib from the internet when I use it? Then what is the different between java se + external lib and java ee? Or Did I make any mistake when I installed?
Thank you guys!

Related

bundled JavaDB in java 8 setup

I've read that in Java 8, derby DB embedded driver in bundled(included). Is that true and if so how to refer to it in eclipse?
According to the technical notes (http://docs.oracle.com/javadb/index_jdk8.html) Java DB (Apache Derby) is only bundled (included) with the Java Development Kit (JDK 7 and JDK 8).
It does not come bundled (included) with the Java Standard Edition Java Runtime installations.
If you have a JDK installed, one way to access it from Eclipse is to add the /db/lib/derby.jar file into a user-defined library, and add that library to the build path of your project(s). This is the easiest, but highly discouraged as it will be hard to resolve these types of dependencies when the application needs to be launched outside of Eclipse.
Once you are comfortable with JavaDB, I would recommend that you use Maven/Gradle to manage building and deploying, as well as using Apache Derby.

Can a jar which is compiled on old java version be used in new applications?

We are planning to upgrade our J2EE application, I worked with a lot of jars before and I know that the version mismatch can be a hard problem to debug. We have all the jars(internal to company and built by some other team so cannot recompile with latest version ) compiled using 1.6 jdk and we are bumping up our application version to 1.7, but we are planning to use 1.6 version jars in our app. Does this work well? If not what should I do to make it compatible?
I'm sure that it will work well but, need some expert opinion on this.
Thank yo
As you can see on Oracle's homepage regarding compatibility of Java 1.7 it should be compatibale except for the following things
Binary Compatibility
Java SE 7 is binary-compatible with Java SE 6 except for the
incompatibilities listed below. Except for the noted incompatibilities,
class files built with the Java SE 6 compiler will run correctly in Java SE 7.
Quote from oracle

Why is a Java EE runtime Environment required for interpreting/parsing/compiling any code?

I imported an EAR project I had written on another system into eclipse so I had code before I had completely set up the GlassFish server environment and some other config files.
I noticed that even though I had a JDK and JRE integrated with my Eclipse environment it wasn't recognizing any library files like javax. This was preventing any kind of debugging until I had finished installing the runtime environment which for me was GlassFish 3.1.
I am confused about what all the runtime environment contains because I thought the libraries necessary to interpret my code in the IDE were in the JDK and WPT web tools that I had installed and not on the GlassFish server which I think of as "just a container and Java EE server".
Java SE does not include the Java EE libraries.
There are non-Java EE javax.* packages in Java SE, however.

Building a Java EE app on Mac OS X Snow Leopard for Glassfish 3

I'm having a bit of a problem building a Java Enterprise Edition web application on Mac OS X 10.6.2 using Ant 1.7.1, Glassfish v3 and Java EE 6.
The problem is that the build process does not find the Java EE libraries which fair enough as I don't think Apple supply them with the default Java installation but I know they exist in the Glassfish distribution.
Which jars are the correct ones to build against (I'm assuming javaee.jar is a general jar which references all the other needed jars) and what should I be putting in my ant build.xml file?
Any help is very much appreciated.
You need to have the javaee.jar in your ant classpath, but be aware: do not copy the javaee.jar to the webapp (WEB-INF/lib folder)!
I would encourage you to get and use NetBeans or GlassFish Tools Bundle For Eclipse to start working with Java EE 6 and GlassFish v3... (read my profile to find out why).
If you are determined to avoid using either of these IDEs, then I would recommend that you download the Java EE 6 SDK, to get started. The SDK includes a number of different samples that can be built and deployed using Ant. (Use -verbose to learn the 'secrets')

for-each loops and generics in Java EE

I am designing a website-based project wherein I first designed my logical layer in Java SE application development. Then I made the GUI in Java EE for the website. I am importing my Java SE files in the Java EE architecture using JSTL and I will call the data using this only.
But, it is giving me an error as follows:
for-each loops -- for-each loops are not used in source 1.4, try source 1.5 to enable for-each loop.
generics -- generics are not supported in source 1.4, try source 1.5 to enable generics
variable-arity methods are not supported in -source 1.4
It appears you have the wrong JDK selected - all those features were added in JDK 1.5. Make sure you have the 1.5 JDK selected for both your IDE, and your web application App Server. This should resolve your problem.
If you are building via Ant or by the command line, ensure that you specify "-source 1.5" on the javac command line. Also, JSP files will not necessarily use Java 5 features by default. This depends on what Servlet standard you're using. For example, see this blog entry that tells you how to set Tomcat 5.5 so it will allow 1.5 features in its JSPs.
In Netbeans the Java EE format is part of the project settings. Unfortunately it can't be changed in the project settings once you have created the project.
Create a new project with the Java EE 5 version and copy your source across.
To be able to select Java EE 5, you will need a Java EE 5 capable server installed, eg. Tomcat v6 or GlassFish v2. You can install the servers using the NetBeans Tools->Servers menu.

Categories

Resources