9
CS7 Recitation Cem Akkaya

CS7 Recitation Cem Akkaya. Outline Homework-0 in detail Useful links and tools Setting up your java environment

Embed Size (px)

Citation preview

Page 1: CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment

CS7 Recitation

Cem Akkaya

Page 2: CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment

Outline

Homework-0 in detail Useful links and tools Setting up your java environment

Page 3: CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment

HelloWorld

java is case sensitive Key words are reserved main method is the starting point of each application each statement ends with a semicolon when you open a brace, you have to close it the name of the java file has to be exactly the same as the

class name (e.g. Hello.java)

//HelloWorld programpublic class Hello {

public static void main(String[] args) { System.out.println(“Hello World") ; }

}

Page 4: CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment

HelloWorld A program consists of binary instructions,

which are executed by CPU Two steps to transform our source code in

machine instructions (machine language)

Figure from Java Tutorial @ http://java.sun.com

Page 5: CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment

HelloWorld Java VM allows the same application (.class

files) to run on multiple platforms - platform indepence

Figure from Java Tutorial @ http://java.sun.com

Page 6: CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment

Upload Example

Page 7: CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment

Useful Links & Tools Sun Developer Network (http://java.sun.com)

API Documentation (http://java.sun.com/javase/6/docs/api/) Tutorial (http://java.sun.com/docs/books/tutorial/) Google

Integrated Development Environments (IDEs) Eclipse (http://www.eclipse.org/) NetBeans (http://java.sun.com) jGrasp (http://www.jgrasp.org/) Notepad++ (http://notepad-plus.sourceforge.net/) - not

a IDE

Page 8: CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment

Setting up java environment Download and install Java SDK from

http://java.sun.com/ Update the path environment variable

Windows Command Prompt (changes effective for session) “set path=JAVA_DIR\bin” “set path= %path%;JAVA_DIR\bin”

Windows Control Panel (changes are permanent) Over Control Panel-Performance and Maintenance-

System-Advanced-Environment Variables In Unix systems setting environment variables is shell

specific.

Page 9: CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment

Questions ?