Eclipse - Java

Páginas: 18 (4429 palabras) Publicado: 16 de julio de 2011
1

The author has made every effort in the preparation of this book to ensure the accuracy of the information. However, information in this book is sold without warranty either expressed or implied. The author will not be held liable for any damages caused or alleged to be caused either directly or indirectly by this book.

Java, Eclipse, Maven & JSF tutorial
Maven 2 is a powerful tool thatpromotes convention over configuration and you need to integrate it into one of the popular integrated development environments (IDEs) called eclipse to make your work easier, thus increasing your productivity and project quality. This tutorial provides an example of how to make Maven and Eclipse collaborate. Also covers the popular JSF Web framework.

by

K. Arulkumaran & A. SivayiniWebsite: http://www.lulu.com/java-success Feedback email: java-interview@hotmail.com

2 Table Of Contents Notations ..................................................................................................................... 3 Tutorial 1 – Java, Maven and Eclipse .................................................................. 4 Tutorial 2 – Java Web, Maven andEclipse....................................................... 16 Tutorial 3 – JSF, Maven and Eclipse.................................................................. 28 Appendix ................................................................................................................... 58

3 Notations
Command prompt:

Eclipse:

File Explorer or Windows Explorer:

Internet Explorer:

4 Tutorial 1 –Java, Maven and Eclipse This tutorial will guide you through building a simple Java application from scratch using popular tools like eclipse and maven. This tutorial will be handy for those who are new to maven/eclipse/Java.
Install the following programs. In this tutorial I have installed them under c:/java. Java 1.5 (JDK1.5 & JRE1.5) site: http://java.sun.com/javase/downloads/index_jdk5.jsp. .Also set the environment properties JAVA_HOME (e.g. C:\java\jdk1.5.0) and add to the path (e.g. %JAVA_HOME%\bin). If installed correctly you should be able to test it by opening a command prompt and typing C:\>java –version Results in: java version "1.5.0_11" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03) Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)Maven 2.0.7. Site: http://maven.apache.org/download.html. Set the environment variables M2_HOME (e.g. C:\java\maven-2.0.7) and add to the path (e.g. %M2_HOME%\bin). If installed correctly you should be able to test it by opening a command prompt and typing: C:\>mvn --version Results in: Maven version: 2.0.7 Java version: 1.5.0_11 OS name: "windows xp" version: "5.1" arch: "x86" Open the “settings.xml”file under C:\java\maven-2.0.7\conf folder and set your local repository as follows: C:/java/.m2/repository Also if your internet access is through a proxy server then configure your proxy server in “settings.xml” for example: optional true http proxyuser proxypass webproxy 8080 local.net,some.host.com Eclipse 3.3.0 (Europa). Site: http://www.eclipse.org/downloads/

So far we have installedthe programs under c:/java. Now we need to create a folder for
our tutorials as c:/tutorials. Also create an eclipse workspace “C:\java\eclipse-tutorial-

5
workspace” where metadata get stored. It is the best practice to separate IDE specific (i.e. C:\java\eclipse-tutorial-workspace) files from the projects (i.e. c:/tutorials) specific files. C:/java folder

C:/tutorials folder

6
Nowlet’s have maven into play. One of the powers of maven is its principle of “convention over configuration”. You can run the following command to create a maven project structure. C:\tutorials>mvn archetype:create -DgroupId=com.mytutorial -DartifactId=simple The above command results in some directories & files created under c:/tutorials. E.g. C:\tutorials\simple project called “simple” “src”...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • ejercicios resueltos eclipse de java
  • Ejemplos Java En Eclipse
  • eclipse java
  • instalar JDK y Eclipse para Programar en Java
  • Eclipse java resumen
  • SENTENCIA IF-ELSE (JAVA ECLIPSE)
  • Eclipses
  • Los Eclipses

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS