bundled JavaDB in java 8 setup - java

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.

Related

Compile without IBM WAS 7 installed

We are using IBM WAS 7 as the server for our application. But the organization's rules do not allow us to have servers installed in workstations. I have this J2EE web project that uses WAS 7 as the target server runtime.
At first, I installed WebSphere® Application Server V7.0 tools for Eclipse. I thought it will provide the runtime along with it as well. Now I can see the option of WAS 7 in server runtime, but on selecting it I have to provide the path where WAS 7 is installed. And I don't have that.
Can I use any other server runtime and expect that it will work within WAS 7? If not, is there any way to just get the runtime without installing the server?
If you are using fully standard Java EE APIs (and no special WebSphere classes), you can simply add the Java EE API jars to your project classpath.
Since WebSphere 7 is Java EE 5 compliant, you could go to maven and download the Java EE 5 API jar and add it to your classpath. This will allow you to compile your code in eclipse.
If you need some WebSphere specific APIs, then you need to tell your development organization that you need to have access to the Jars somehow so that you can compile your code against them. Have your legal team investigate if you can distribute the WebSphere jars to developers for compiling purposes.
Another option is downloading WebSphere Liberty (which is free for development useage) and using Liberty to compile and run your code locally. Note that you will have to install a really old version of Liberty to have it match up with the Java EE 5 WebSphere version 7 (currently Liberty is EE 7 compliant).
Disclaimer: I am a developer for both WebSphere Traditional and WebSphere Liberty. The reason I am suggesting Liberty instead of other app servers is because the askers org is ultimately using WebSphere Traditional, and Liberty will have the closest match in behavior.
It depends a little on the meaning "But the organization's rules do not allow us to have servers installed in workstations".
Often this is due to licencing constraints, in which case you can install an open-source J2EE server like Tomcat or JBOSS. So long as your apps do not call IBM-specific libraries, the same binary should run on any of these environments.

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

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!

Upgrade Eclipse from Java Dev to Java EE dev

I have Eclipse for Java Developers installed, and I installed the Java EE JDK to start working on Java EE.
How can I upgrade my Eclipse For Java Developers to Eclipse For Java EE Developers?
There might be some way using the update stuff, but I would just download the right version of Eclipse for what you want and start with that. It's easy and fast.

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