Skip to main content

Java EE 6 For Beginners – Setting Up Development Environment

ec_featured

Introduction

Hello everyone! How are you? I’m going to write a series of articles to show you basic stuffs of Java EE 6 platform technologies. We will start from Java EE 6 environment configuration, then go to JSF, JPA, EJB, Web Services, Dependency Injection…

My personal opinion maybe has mistakes, so I’d like you to pointed out and commented blow the articles! 😀

prepare

To start this tutorial, you need two tools, Eclipse IDE, and Weblogic application server, you could choose other servers if you are familiar with, JBOSS, GlassFish etc. You can download these tools in the following links:

Eclipse Juno: http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr2

Weblogic server 12c: http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html

The weblogic server download page is like this:

Weblogic download page
Weblogic download page

I have chosen Generic Installer (997MB) – for use with 64-bit JVM, you can choose other installer files depend on your operation system and JVM version.

Note: You need to login to download the installation file.

Weblogic Installation

Go to directory that you downloaded weblogic installer file:

Weblogic Installation Command
Weblogic Installation Command

In my case, the weblogic installation file is a jar file, run it in cmd:

java -Xmx1024m -jar wls1211_generic.jar

The installation guide will be shown(sorry my operation system is Chinese localized, but it dosen’t matter 😀 )

Weblogic Installaction guide 1
Weblogic Installaction guide 1

click Next

Weblogic Installaction guide 2
Weblogic Installaction guide 2

Choose middleware home directory(H: is my secondary SATA hard drive, I didn’t make partition, so I created some folders D, E, F, G, 😀 So it looks strange.  ). Click Next.

Weblogic Installaction Guide 3
Weblogic Installaction Guide 3

Type your Email which was registered when downloading the installation file. If you want to receive security updates, you need type your password. Click Next.

Weblogic Installaction Guide 4
Weblogic Installaction Guide 4

Select installation type, you could choose Typical or Custom(In my case, I want to show you what would be installed). Click Next.

Weblogic Installaction Guide 5
Weblogic Installaction Guide 5

You can see, except Examples, all of the components are being installed, so, I kept default selection, and then click Next.

Weblogic Installaction Guide 6
Weblogic Installaction Guide 6

You have to choose the JDK directory, select one like above. Click Next.

 

Weblogic Installaction Guide 7
Weblogic Installaction Guide 7

Choose directories to install Weblogic and Coherence, respectively. Click Next. Verify your installation infomation, then click Next to install.

If no error occurs, congratulations! You have installed weblogic successfully.

Create a domain

Open Welogic Configuration Wizard from start menu.

Domain Configuration

 

choose create a new weblogic domain, click Next.

Domain Configuration

 

Give the domain a name, and location, I use the default. Click Next.

2013-5-14 12-51-53

 

Choose Development Mode, make sure that there’s one JDK available. Click Next.

Weblogic Configuration

 

 

 

 

Create Admin User name and Password, you need to remember this to login Weblogic Console.Domain Configuration

Choose optional configuration, I use default which is none selected. Click Next.

Domain Configuration

 

Set the Admin Server name(you needn’t to care about it now), Keep other’s default. You can change the Port as needed. Click Next.

Domain Configuration

 

make confirmation, click Create. When creation complete, you can go to your base_domain folder to start the server, Mine is located at:

H:DoracleMiddlewareuser_projectsdomainsbase_domain

find startWebLogic.cmd, open it. Wait seconds, util  <The server started in RUNNING mode.> has been showed.(This line may not be the last one)

Now you can open your web browser, open “localhost:7001/console”, you will see the login page, use your admin user name and password to login. Now, the weblogic configuration is completed. Next, we well configure Eclipse to integrate with weblogic.

Eclipse

Extract your Eclipse, open it, in the servers pane, click new server wizard…

Add Weblogic Server

There’s no weblogic server type be default, we need to get one. Click Download additional server adapters.

Add Weblogic Server

select Oracle Weblogic Server Tools, click Next.

Add Weblogic Server

 

You must accept the agreements, click Finish.

Add Weblogic Server

 

click OK when promoted. The installation will begin, when it finished, you must restart Eclipse to take effect.

Now, Lets create Weblogic Server now,  click new server wizard…

Add Weblogic Server

 

Now you can see Weblogic Server adapter, select Oracle Weblogic Server 12c, give Server a host name and Server name, click Next.

Eclipse Configuration

 

Choose Weblogic home and Java home, click Next.

Eclipse Configuration

 

choose your domain directory that we created before. Click Finish. OK, that’s it!

Conclusion

To simplify the process of Java EE 6 Environment Configuration, follow the instructions below:

  1. Install Weblogic Server
  2. Confiure Weblogic Domain
  3. Install Eclipse
  4. Add Weblogic Server Adapter
  5. Add Weblogic Server

That is quite simple, I post plenty of pictures to give you more details of the configuration. Hope you can learn useful information from this article. 😀