Eclipse Ide For J2ee Developers

Posted on by admin

This article describes how to integrate WebLogic Server in the latest supported version of Eclipse IDE for Java EE Developers. You need to start by getting all of the pieces - Java SE Development Kit, WebLogic Server, and Eclipse IDE. The Eclipse IDE is famous for our Java Integrated Development Environment (IDE), but we have a number of pretty cool IDEs, including our C/C IDE, JavaScript/TypeScript IDE, PHP IDE, and more. Eclipse is a great open-source Integrated Development Environment that supports a lot of languages. Install a Java Development Kit. For JavaEE work, I currently prefer JaveSE. Browse to Oracle’s Java SE Development Kit downloads; In the section titled Java SE Development Kit 9.0.1, read the license and, if you agree, click Accept License. Eclipse JST Server Adapters (Apache Tomcat, JOnAS, J2EE) This is quick way to install Eclipse JST Server Adapters and JST Server Adapters Extentions (Apache Tomcat, JOnAS, J2EE) This entry was created when Eclipse IDE for Java Developers was promoted. Web, Web Services, Application Server.

Details
Written by Nam Ha Minh
Last Updated on 07 August 2019 Print Email
This tutorial helps you get familiar quickly with Eclipse - the most popular IDE for Java development. In order to use Eclipse effectively, you should get familiar and understand some key concepts and components in the IDE: Workbench, Workspace, Perspective, Editor, View and Toolbar.First, let’s see how to download and install Eclipse IDE.

1. Download and Install Eclipse

Eclipse IDE is available on major operating systems: Windows, Mac OS X and Linux. It supports both 32 and 64-bit CPU architecture. Eclipse IDE is a Java-based application so it requires JDK/JRE installed first.You can download and install Eclipse in one of two ways: using an installer or download a ZIP package.Download and Install Eclipse IDE using Eclipse Installer:In this way, you download a small program called Eclipse Installer. Run this program and choose a package you want to install:

Then the installer downloads and installs the selected package onto your computer.The benefit of using Eclipse Installer is that you can install any desktop package of Eclipse in one place, and it also creates shortcuts on desktop and Programs menu for you. Here’s the link to download Eclipse Installer (64-bit):Note that you need to choose a mirror site to download from.Install Eclipse IDE by downloading a ZIP package:In this way, you download a zip/tar file for a specific package and extract the file on your computer. Run the eclipse.exeprogram in the eclipse directory to launch the IDE:And if you want to have shortcuts on desktop and in Programs menu, you have to manually create them. Here’s the link to download the package Eclipse IDE for Java EE Developers:Note: Eclipse IDE depends on JDK/JRE so make sure that you have JDK/JRE installed on your computer. and configure the JAVA_HOME and PATH environment variables properly (See: How to set environment variables for Java using command line).The above package requires Java 8 or newer.

2. Workbench

A window instance of the IDE is referred to as the WorkbenchJ2ee. A workbench window consists of one or more Perspectives. And a perspective contains Editors and Views.You can open multiple workbench windows simultaneously (via menu Window > New Window). For example, when you are working on two projects - you can open two workbenches - each for one project. But all workbenches are used for only one Workspace.

3. Workspace

Workspace is a directory on your computer - where the projects are stored. You must choose a workspace when starting Eclipse:There can be one or more projects in a workspace - which means you can work with multiple projects simultaneously. However, you can work in one only workspace in a working session of Eclipse. And to switch to another workspace, click File > Switch Workspace from the main menu.Eclipse stores preferences separately for each workspace in the .metadatadirectory in the workspace’s root. That means each workspace has its own settings for layouts, JDKs, servers, etc.So you use a workspace to group related projects that share common settings. For example, you can create a workspace (create a directory) for developing an application that consists of several projects; a workspace for Swing projects; a workspace for Java EE projects; a workspace for Spring projects, and so on.The following screenshot shows multiple projects listed in the current workspace:Eclipse for eeEclipse

4. Perspectives

In Eclipse, a perspective provides initial layout that is organized to help programmers accomplish a task or work. Each perspective contains a different set of editors and views. For example, the Java perspective contains the following editors and views:

- Java Editors: for editing Java source files.

- Package Explorer: allows you to navigate the projects.

- Outline: displays the structure of source file in the active editor.

- Problems: shows errors, warnings and problems detected.

- Javadoc: allows you to preview Javadoc of a class, method, field…

- Declaration: shows declaration statement for the variable at the cursor position.

- Task List: displays tasks downloaded from a popular bug tracker tool like Bugzilla, Mantis…

The following screenshot is of a Java perspective:When you are working in the perspective, you and open more editors and views when needed, but initially a perspective contains a fixed set of editors and views. The toolbars and menu items are also changed according to the purpose of the current active perspective.And this is the Debug perspective that allows you to debug a running program:By default, Eclipse provides several perspectives, as shown below:You can see this list when opening a perspective from the menu Ide

Eclipse Ide For J2ee Developers 64 Bit

Window > Perspective > Open Perspective > Other…For Java development, you use only few perspectives most of the time, e.g. Java, Java EE and Debug. If you use version control, then you will frequently switch to Git or Team Synchronizing perspectives.In Eclipse, you can switch among opened perspectives by clicking on the perspective icons in the toolbar or by pressing the shortcut Ctrl + F8. You can open perspectives in the same workbench window (default) or in new windows.Note that different perspectives can have different views but they all share the same editors.You can customize a perspective, e.g. arrange views and editors in the way you like, and save it as your own perspective.To reset the active perspective to its default layout, click Window > Perspective > Reset Perspective…

5. Editors

An editor allows you to edit a source file. For example, when you double-click a .javafile in the Project Explorer/Package Explorer view, a Java editor is opened in the editor area which is usually at the center of the workbench:Notice the gray border at the left margin of the editor area may show small icons to indicate errors, warnings, problems and information at the corresponding line.Each type of find can be opened with the associated editor. If Eclipse doesn’t have associated editor for a file type, it will try to open using an external program available in the operating system.There can be multiple editors opened and they are stacked in the editor area, but only one editor is active at a time. The name of the file is displayed in the title bar of the editor, and the asterisk (*) indicates that the editor has unsaved changes.In Eclipse, you can use the shortcut Ctrl + F6 to switch among editors.

6. Views

A view allows you to navigate the information in the workbench. For example, in the Project Explorer view, you can navigate the structure of projects in a workspace:A view also provides alternative representation to support an editor. For example, the

Eclipse Ide For Java J2ee Developers

Outline view displays structural elements of the source file in the active editor. So if you are editing a .javaDownload eclipse for ee developersfile, it displays the classes, fields and methods of that file:Using the Outline view, you can quickly jump to an element in the source file.You can resize, move, minimize and maximize views in a perspective. A view can be detached from the workbench and becomes a floating window (right-click on a view’s title bar and click Detach).A view has a pull-down menu that offers actions allowing you to customize the representation of the view. You can access this menu by clicking on the down arrow at the top right corner of the view. For example, the following screenshot shows the pull-down menu of the Project Explorer view:To open a view in Eclipse, click Window > Show View

Eclipse J2ee Download

. And to switch among opened views, press Ctrl + F7.

7. Toolbars

The last visual component I want to tell you in Eclipse is the toolbars. There are 4 kinds of toolbars in Eclipse:- Main toolbar: appears below the main menu, the main toolbar consists of buttons that are grouped into different sections: Open/create/save project, Run, Debug, Navigation, Search…The buttons vary depending on the current perspective.

a

- Individual view toolbar: a view can have its own toolbar in its title bar area or at the top-right corner. For example, you can see the toolbar of the Servers view in this screenshot:- Perspective switcher toolbar: this toolbar contains buttons that allow you to switch among opened perspectives in the workbench. You can see this toolbar at the right side of the main toolbar:It also contains a button (the left most one) that allows you to open the list of all perspectives.- View stack toolbar: this is a special toolbar which appears when you minimize a view in a view stack. The icons on this toolbar allow you to open an individual view in the stack. For example, here’s the toolbar appears when the Console

Eclipse Enterprise Edition

view is minimized:So far you have got familiar with the key concepts and components in Eclipse IDE. By understanding them, you know how to use the IDE properly and effectively.

Other Eclipse Tutorials:


About the Author:

Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on Facebook and watch his Java videos you YouTube.

Up until now we have been using Eclipse Classic to compile servlets and we copied the *.class files manually into the folder /WEB-INF/classes. So that the changes are updated we restart the Tomcat server manually. In this tutorial, we will see how to simplify this process using Eclipse para java EE. This version also includes, html and jsp editors, which make the job with this type of files, easier.

Eclipse Ide For J2ee Developers Oxygen

The first thing we are going to do download Eclipse IDE for Java EE Developers and install it in our computer. Download the *.zip file and decompress it in a folder. Inside de installation directory (in my case C:eclipseJEE2) we execute eclipse.exe and indicate the workspace (in my caseC:eclipseJEE2workspace), which is the directory where we want to work.

Register the Tomcat server in Eclipse

We then look for the servers view to register the Tomcat server we are using. In the contextual menu(right mouse button over the view), we choose new server which takes us to a window where we choose the server we want to add.

Among the servers we can see the servlets containers we´ve talked about before (WebSphere, JBoss, etc). We choose Tomcat versión 6, which is the one we use for this tutorial and we will see a window as the one below.

We click the button Browse and we select the directory where our Tomcat installation is and we click in Finish.

Now we can see the Tomcat server in the server view and also a new project called Servers where we can also see our Tomcat server..

Create a Web project called first-jee

In the Project Explorer view, right button on the mouse- new- project.

In the new project window, inside the Web folder, we select Dynamic Web Project.

As you can see in the window; New Dynamic Web Project apache tommcat 6, has already been selected as our target runtime. If we had another server installed as JBoss and we were going to work with JBoss we would change the target to JBoss.

To keep this tutorial simple we will ignore the rest of the configurations, we fill Project name with first-jee as the name of our project and we click on finish.

Project structure

In the projects view we can see the structure of the project we have just created. There are two folders which are interesting for us:

  1. Java Resources: in here we have all the *.java files and eclipse will be in charge of publicating, automatically, the *.class where they correspond.
  2. WebContent: here we have the *.html, *.jsp files, etc. Inside this folder we can see the J2EE standard structure for a project; the folder WEB-INF, the web.xml file, etc.

Copy the last example and execute it

We are going to repeat the last tutorial using this eclipse. For this we are going to copy the web.xml, login.html and LoginServlet.java files from the last tutorial Parameters, GET and POST methods in Servlets to our project. In the graphic below we can see how the project will look like.

Eclipse Ide Download

Lastly we click on the right button of the mouse over login.html - Run as - Run on Server and the Run On Server window will appear.

Click on finish and we obtain:

What happened here? magic ;) after clicking on finish, eclipse did the following:

  1. Publish our application in Tomcat. Step known as Deployment.
  2. Start the Tomcat server
  3. Open a browser or internal http client pointing to http://localhost:8080/first-jee/login

If we fill in the user and password with edu4java and eli4java respectively and we click on Submit Query, we obtain:

In the following tutorial we will see more on how JEE eclipse works...

<< Parameters, GET and POST methods in Servlets.Web application Deployment >>