Java With Eclipse: Setup & Getting Started: For Customized Java-Related Training at
Java With Eclipse: Setup & Getting Started: For Customized Java-Related Training at
Java With Eclipse: Setup & Getting Started: For Customized Java-Related Training at
Developed and taught by well-known author and developer. At public venues or onsite at your location.
Courses
and taught Android,
by coreservlets.com
expertsSpring
(editedMVC,
by Marty)
Java
7, Java developed
8, JSF 2, PrimeFaces,
JSP, Ajax, jQuery,
RESTful Web Services, GWT, Hadoop.
Spring MVC, Core Spring, Hibernate/JPA, Hadoop, HTML5, RESTful Web Services
Installing Java
Installing and configuring Eclipse
Importing sample projects
Executing simple desktop programs from
Eclipse
Executing applets from Eclipse
Executing Java programs manually
Using Beanshell
Eclipse shortcuts
Installing Java
Customized Java EE Training: http://courses.coreservlets.com/
Java 7, Java 8, JSF 2, PrimeFaces, Android, JSP, Ajax, jQuery, Spring MVC, RESTful Web Services, GWT, Hadoop.
Developed and taught by well-known author and developer. At public venues or onsite at your location.
Java SE Versions
Latest Java SE version
Latest is Java 8; Java 8 should be used for almost all new
projects.
Java 8 was final in March 2014. This tutorial covers general Java
programming integrated with Java 8, but for just the Java-8specific topics, see http://www.coreservlets.com/java-8-tutorial/.
Java 6
Minor update. Updates to collections, Swing, etc.
Java 7
Minor update. Diamond operator, Strings in switch
statements, try-with-resources, updates to Swing
(especially new look and feel).
Java 8
Major update. Lambdas for functional programming.
Streams for bulk operations. Final version March 2014.
See tutorial at http://www.coreservlets.com/java-8-tutorial/
If you can choose, use JDK 1.8 (but 1.7 still common)
Desktop apps
For best power and speed, use Java 8 (aka JDK 1.8)
Use older only if project is old (but consider upgrading)
Installing Java SE
(Standard Edition)
Install Java
http://www.oracle.com/technetwork/java/javase/downloads/
Installing Eclipse
Customized Java EE Training: http://courses.coreservlets.com/
Java 7, Java 8, JSF 2, PrimeFaces, Android, JSP, Ajax, jQuery, Spring MVC, RESTful Web Services, GWT, Hadoop.
Developed and taught by well-known author and developer. At public venues or onsite at your location.
Installing Eclipse
Overview
Eclipse is a free open source
IDE. Support for Java, Android,
HTML, CSS, JavaScript, C++,
PHP, JSF, servlets, and more.
http://eclipse.org/downloads/
Choose Eclipse IDE for Java EE Developers
Features
Checks your syntax as you type
Automatically compiles every
time you save file
Many tools: refactoring,
debugging, server integration,
templates for common tasks, etc.
Low learning curve:
beginners can use Eclipse without knowing these tools
Running Eclipse
Unzip the downloaded file (no installer!)
Call the folder you unzip into installDir
Click on
Workbench icon
Next time you bring
up Eclipse, it will
come up in workbench automatically
Shortcut
Many developers put Eclipse link on their desktop
R-click eclipse.exe, Copy, then go to desktop,
R-click, and Paste Shortcut (not just Paste!)
Alternative
Can also copy/rename existing class
Developed and taught by well-known author and developer. At public venues or onsite at your location.
Simple Examples
Customized Java EE Training: http://courses.coreservlets.com/
Java 7, Java 8, JSF 2, PrimeFaces, Android, JSP, Ajax, jQuery, Spring MVC, RESTful Web Services, GWT, Hadoop.
Developed and taught by well-known author and developer. At public venues or onsite at your location.
Notes
Application is lingo for a stand-alone Java program
An application is a Java class that contains main
Most Java classes do not contain main, but only those
that contain main can be directly executed
Executing HelloWorld
In Eclipse (recommended)
Compiling
Done automatically whenever you save a file
Executing
R-click inside window, then Run As Java Application
You can also click green arrow at top of Eclipse
Manually (rare)
Compiling
javac HelloWorld.java
Executing
java HelloWorld
Output
Hello, World
<html>
<head>
<title>HelloWWW: Simple Applet Test.</title>
</head>
<body>
<h1>HelloWWW: Simple Applet Test.</h1>
<p>
<applet code="HelloWWW.class" width="460" height="50">
<b>Error! Must have Java enabled in your browser.</b>
</applet>
</p>
</body></html>
Using Beanshell
Customized Java EE Training: http://courses.coreservlets.com/
Java 7, Java 8, JSF 2, PrimeFaces, Android, JSP, Ajax, jQuery, Spring MVC, RESTful Web Services, GWT, Hadoop.
Developed and taught by well-known author and developer. At public venues or onsite at your location.
Overview
Way to run Java commands interactively
Like the command prompt in Python, Basic, Lisp, etc.
Good for beginner practice
Examples
bsh % System.out.println("hi");
hi
bsh % String message = "Hello";
bsh % System.out.println(message);
Hello
bsh % public int getFavoriteNum() { return(7); }
bsh % System.out.println("Favorite num is " + getFavoriteNum());
Favorite num is 7
Steps
Download beanshell
http://www.beanshell.org/download.html
Beanshell is included in intro project of this tutorial
Run beanshell
Double-click the .jar file
If it wont launch on double click, see
http://stackoverflow.com/questions/8511063/how-to-runjar-file-by-double-click-on-windows-7-64
More info
http://www.beanshell.org/manual/bshmanual.html#Quick_Start
Example
Double click
Choose Capture System in/out/err
Enter Java commands interactively
Developed and taught by well-known author and developer. At public venues or onsite at your location.
Autocompletion
Type part of a class or method name, Control-Space
Inserting System.out.println
Type the word sysout, then Control-Space
Wrap-Up
Customized Java EE Training: http://courses.coreservlets.com/
Java 7, Java 8, JSF 2, PrimeFaces, Android, JSP, Ajax, jQuery, Spring MVC, RESTful Web Services, GWT, Hadoop.
Developed and taught by well-known author and developer. At public venues or onsite at your location.
Summary
Downloading Java
http://www.oracle.com/technetwork/java/javase/downloads/
(or /7/)
Downloading Eclipse
http://eclipse.org/downloads/
Questions?
More info:
http://courses.coreservlets.com/Course-Materials/java.html General Java programming tutorial
http://www.coreservlets.com/java-8-tutorial/ Java 8 tutorial
http://courses.coreservlets.com/java-training.html Customized Java training courses, at public venues or onsite at your organization
http://coreservlets.com/ JSF 2, PrimeFaces, Java 7 or 8, Ajax, jQuery, Hadoop, RESTful Web Services, Android, HTML5, Spring, Hibernate, Servlets, JSP, GWT, and other Java EE training
Many additional free tutorials at coreservlets.com (JSF, Android, Ajax, Hadoop, and lots more)
Developed and taught by well-known author and developer. At public venues or onsite at your location.