Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Taught by the author of Core Servlets and JSP, More Servlets and JSP, and this tutorial. tutorial Available at public venues, Customized or customized Java EE Training: versions http://courses.coreservlets.com/ can be held on-site at your Servlets, JSP, JSF 2.0, Struts, Ajax, GWT 2.0, Spring, Hibernate, SOAP & RESTful Web Services, Java 6. organization. Contact hall@coreservlets.com for details. Developed and taught by well-known author and developer. At public venues or onsite at your location.
Installing Java
Customized Java EE Training: http://courses.coreservlets.com/
Servlets, JSP, JSF 2.0, Struts, Ajax, GWT 2.0, Spring, Hibernate, SOAP & RESTful Web Services, Java 6. Developed and taught by well-known author and developer. At public venues or onsite at your location.
Java Versions
Java SE (Standard Edition)
Core Java
Java version used in this class
Latest version is Java 6, 6 which should be used for almost all new projects Naming conventions are confusing
Java 6 == Java 1.6 == JDK 1.6 Java 5 == Java 1.5 == JDK 1.5 Java 2, version 1.4 = Java 1.4 == JDK 1.4
If you can choose, choose use JDK 1 1.6 6 (but 1 1.5 5 still popular)
Desktop Applications
For best p power and speed, p , use Java 6 (aka ( 1.6) )
If you install, use JDK 1.6
Applets A l t
Separate Java Plug-In is required in all recent browsers
For intranet apps, apps use Java 6 On internet, most Java applet sites (e.g., Yahoo! Games) use JDK 1.4 or 1.5, but all require end-user installation
Installing Java
Install Java 6
http://java.sun.com/javase/downloads/index.jsp
Use this version. The JDK Java Development Kit includes compiler for .java files, whereas the JRE Java Runtime Environment is only for executing prebuilt .class files.
This tutorial uses Eclipse, but if you prefer the NetBeans environment, it is very easy to adapt the instructions to that development environment. So, if you prefer NetBeans or your organization has standardized on it, use this download instead of (not in addition to) the one on the left.
Installing Eclipse
Customized Java EE Training: http://courses.coreservlets.com/
Servlets, JSP, JSF 2.0, Struts, Ajax, GWT 2.0, Spring, Hibernate, SOAP & RESTful Web Services, Java 6. Developed and taught by well-known author and developer. At public venues or onsite at your location.
Installing Eclipse
Overview
Eclipse is a a free open source IDE for Java. Support for Java, HTML, CSS, JavaScript, C++, PHP, and more.
Features
Checks your syntax as you type Automatically uto at ca y compiles co p es every eve y time you save file Many tools: refactoring, debugging, server integration, templates for common tasks, tasks etc. etc
Low learning curve: beginners can use Eclipse without knowing these tools
Solution
Find the Eclipse installation folder, edit eclipse.ini, and add the following line to the bottom of the file
-XX:MaxPermSize=256m
Running Eclipse
Unzip the downloaded file
Call the folder you unzip into installDir
Shortcut
Many M d developers l put t Eclipse E li link li k on their th i desktop d kt
R-click eclipse.exe, Copy, then go to desktop, R-click, and Paste Shortcut (not just Paste!)
Configuring Eclipse
For desktop apps, only one step needed
Tell Eclipse where you installed Java
Process
Wi Window d Preferences P f Java J Installed I ll d JREs JRE Press Add, choose Standard VM, navigate to JDK folder ( (not bin subdirectory) y)
E.g., C:\Program Files\Java\jdk1.6.0_20
You can also copy/paste existing class, then give it new name
Simple Examples
Customized Java EE Training: http://courses.coreservlets.com/
Servlets, JSP, JSF 2.0, Struts, Ajax, GWT 2.0, Spring, Hibernate, SOAP & RESTful Web Services, Java 6. Developed and taught by well-known author and developer. At public venues or onsite at your location.
St Start tE Eclipse li and d go to t Workbench W kb h File Import General Existing Projects into Workspace p Select archive file ( (not Select root directory).
Then browse to ZIP file you downloaded, OK, Finish
Notes
A Application li i is i lingo li for f a stand-alone d l Java program An application is a Java class that contains main
Most Java classes do not contain main, main , but only those that do can be directly executed
Executing HelloWorld
In Eclipse (recommended)
Compiling
Done automatically whenever you save a file
Executing g
R-click inside window, then Run As Java Application
Manually
Compiling p g
javac HelloWorld.java
Executing
java HelloWorld
Output
Hello, World
Wrap-Up
Customized Java EE Training: http://courses.coreservlets.com/
Servlets, JSP, JSF 2.0, Struts, Ajax, GWT 2.0, Spring, Hibernate, SOAP & RESTful Web Services, Java 6. Developed and taught by well-known author and developer. At public venues or onsite at your location.
Autocompletion
Type yp part p of a class or method name, , Control-Space p
Summary
Downloading Java
http://java.sun.com/javase/downloads/index.jsp
Downloading Eclipse
http://eclipse.org h // li
Q Questions? ti ?
Customized Java EE Training: http://courses.coreservlets.com/
Servlets, JSP, JSF 2.0, Struts, Ajax, GWT 2.0, Spring, Hibernate, SOAP & RESTful Web Services, Java 6. Developed and taught by well-known author and developer. At public venues or onsite at your location.