Web development with Eclipse Europa, part 1th

Source: Internet
Author: User
Tags ini memory usage versions java web tomcat apache tomcat

Being a web developer coincides with the time. There's never been as many technological choices as now. A wide range of excellent open source Web servers, databases, programming languages, and development frameworks are available for you to use. Regardless of which technology combination you want to use, there is an integrated development environment (IDE) that can improve productivity: Eclipse. This tutorial is part 1th of the three-part series "Web Development with Eclipse Europa", which will show you how to use the Java™ technology, PHP, and Ruby web development through eclipse to see how to work with eclipse The latest version of--europa--to quickly develop Java WEB applications. We will use the Java Platform, Enterprise Edition 5 (Java EE) for Eclipse to build a WEB application for tracking and computing baseball statistics.

Before you start

The Eclipse developer has been working to make it easier for web developers to work. Eclipse's Europa release provides several adapted versions of Eclipse, including those that are suitable for WEB developers.

About this series

In the "Web Development with Eclipse Europa" series, you will learn that, regardless of the language you choose, Eclipse is a platform for web development. A flexible plug-in system makes it easy to create a variety of Eclipse versions tailored to WEB development using Java technology, PHP, and Ruby. You'll see how different plug-ins provide unique Eclipse functionality for each language, and you'll see some common features that all WEB developers can take advantage of. In this series, we will create a sample baseball Web application that will allow us to enter the game data for the baseball players and calculate the stats for those players.

About this tutorial

As part 1th of the three-part series, this tutorial will use the Eclipse Java EE version for Java WEB Development, connect to the database using Eclipse, create tables, and create test data in the database. Configure Eclipse to use a Web server, and then use the Eclipse Wizard to create Web applications, Web pages, and data access code. Finally, you will use Eclipse to control the WEB server, publish the application, and even debug the application when the application is running on the server.

Prerequisite

Having a Java programming background is critical to maximizing the effectiveness of this tutorial. Familiarity with the Eclipse IDE can be very helpful, but not necessary.

System Requirements

The following conditions need to be met:

Eclipse Europa This tutorial will use Eclipse V3.3 (Europa). Java Development Kit (JDK) This tutorial will show you how to develop WEB applications using Java technology, so you need to use Java Development Kit (JDK) 5.0 or later. Download V5.0 or V6.0. The Eclipse IDE for Java EE developers also needs to use the Eclipse IDE for Java EE developers. The Java Runtime Environment (Java Runtime ENVIRONMENT,JRE) must be equipped with a JRE to run Eclipse. The Apache Tomcat application will use Apache Tomcat as a container. The MySQL V5.0 application will use the MySQL V5.0 as the database. The Java Persistence API also needs to use the Java Persistence API, especially OpenJPA implementations.

Eclipse: Which version?

If you look at the downloads section of eclipse.org, you will see several available Eclipse releases. We will use the Eclipse IDE for Java EE developers.

Java EE

The Eclipse IDE for Java EE Developers will provide you with the functionality you need for Java WEB development: Java compilers and debuggers, support for Java application servers, database clients, Web applications, Web services, and Ent Erprise JavaBean (EJB) wizard, and so on. It is important to note that the HTML file and the Java Server Page (JSP) graphics editor. Most of the functionality that comes with it can be found in previous versions of Eclipse. Before Europa release, you need to download the version that is now known as the Eclipse Classic and install additional plug-ins. With the Europa release, the operation has been simplified and the Java EE Package has been fully tuned for Java WEB development.

Tip: Java EE packages are packaged by functionality. To support all of these features, you need to consume some resources from your development computer. It is recommended that you edit the Eclipse.ini configuration file to increase the amount of Europa memory usage. Depending on the operating system you use, this file will be stored in a different location. To increase the amount of memory used, please edit the-vmargs. The memory settings used during the development of the application in this tutorial are as follows:

Listing 1. Eclipse.ini-vmargs

-Xms256m
-Xmx512m
- Xmn128m
-XX:+UseParallelGC
- XX:MaxPermSize=128m

Install the Java EE version of Europa, and then configure the database and Web server. The steps are then reviewed.

Infrastructure

Eclipse makes WEB development simpler than ever, but we still need some infrastructure. A database that needs to be used to save and retrieve data. Eclipse provides an excellent tool for working with databases, so what you need to do is create an empty database or reuse an existing database. The MySQL command shown below will create an empty database.

Listing 2. Creating a Database

mysql>
Newton:~ michael$ mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor. Commands  end with ; or \g.
Your MySQL connection id is 9
Server version: 5.0.41 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the  buffer.

mysql> create database baseball;
Query  OK, 1 row affected (0.04 sec)

mysql>

A part of the infrastructure has been completed. Now you need a WEB server. You can use any of the Java Web containers, including application servers, such as Apache Geronimo or ibm®websphere®. Keep everything as simple as possible and use only one Web container--In this case, Apache Tomcat V6.0. You do not need to perform any special operations on Tomcat. Now that the infrastructure is in place, let's use Eclipse to develop the WEB application.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.