![Page 1: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/1.jpg)
Getting Started With JavaDownloading and installing softwareRunning your first program
Dr. Dwyer Fall 2012
![Page 2: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/2.jpg)
ObjectiveSet up a development
environment on your laptop/desktop and run a program
![Page 3: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/3.jpg)
What tools do you need?Components of the Java language
◦Tool to test whether your program complies with Java syntax requirements (Java compiler – javac)
◦Documentation describing what tools are available in Java
◦Java runtime environment (JRE) – a kind of utility (like a plug-in) that runs Java code on a client (like a laptop or a phone)
![Page 4: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/4.jpg)
Software DevelopmentEclipse – is a tool that makes it
easier to develop softwareOpen sourceCan support other languages
besides Java◦Editor – for writing code◦Support for testing – way to run
code, display output, and other tools for fixing programming errors
![Page 5: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/5.jpg)
Software downloads (2 parts)Java Development Kit (JDK)
includes JRE – Java Runtime Environment
Most recent version Java SE (Standard Edition) 7update 6
Google Java JDK (will include links to instructions)
Java SE Downloads
![Page 6: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/6.jpg)
Downloading EclipseDownload “Eclipse IDE for Java
Developers”http://www.eclipse.org/downloads
/Consult instructions for
installation depending on your operating system
32 bit or 64 bit? – doesn’t matter, but 64 bit does not work with Chrome (use Firefox)
![Page 7: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/7.jpg)
Starting EclipseSelect a workspace
◦This is like “My Documents” for eclipse, a place to keep all files related to your programs
◦Can keep default or change it to a place easy to find (like the desktop)
Step 1: Create a new project(Eclipse menu – File, new, New Java Project)
![Page 8: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/8.jpg)
![Page 9: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/9.jpg)
![Page 10: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/10.jpg)
Create a projectWhat is a project?
◦Container for a collection of software components
◦Need a project in order to run code in Eclipse
◦We will start off with a simple project with one class
![Page 11: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/11.jpg)
Add a Class – right click on project
![Page 12: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/12.jpg)
What is a class?Container for a unit of codeEvery Java program has at least
one classClass name must begin with
CapitalCheck box to create “main”
method stub◦What if you forget?◦Option one – delete the class and
add another one with a different name
◦Option two – need to type “public static ….”
![Page 13: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/13.jpg)
![Page 14: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/14.jpg)
Java program stub
![Page 15: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/15.jpg)
Running a program
![Page 16: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/16.jpg)
Program output
![Page 17: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/17.jpg)
Your AssignmentInstall Java and Eclipse, run the
program in listing 1.1Take a screenshot of your
program after it runs, copy it into a Word document with your name and upload to Blackboard
![Page 18: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/18.jpg)
![Page 19: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/19.jpg)
Recommendations for beginning programmersPractice by typing in examples
from the book EXACTLY as you see them
Java expects perfectionJava does not tolerate sloppy
typing LOL!Be humble – if it does not work,
something really is wrong
![Page 20: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/20.jpg)
Recommendations cont.Use the Internet – lots of tutorials
and videos availableAsk your instructorAsk your class mates and other
Seidenberg students for help
![Page 21: Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012](https://reader030.vdocuments.net/reader030/viewer/2022032706/56649dd95503460f94acf681/html5/thumbnails/21.jpg)
What if you get stuck?Come to Seidenberg School
offices with your laptop and ask tutors or other students for help
Email me for helpUse Google and YouTube to find
Java/Eclipse videos/tutorials