easy java installation & practice

25
Practice for java beginners Java programming Nooria Esmaelzade 2016

Upload: nooria-esmaelzade

Post on 09-Apr-2017

55 views

Category:

Self Improvement


0 download

TRANSCRIPT

Page 2: Easy java installation & practice

Start!!?? Java is a simple programming language.

Writingcompiling and debugging a program is easy in java.

Page 3: Easy java installation & practice

Start programming with java

Install JDK (java development kit)

Install eclips (IDE)

Page 4: Easy java installation & practice

What is JDK & eclips?JDK enables us to develop and run a java program

Eclips is the environment where we write the codes

Page 5: Easy java installation & practice

JDK installation

Page 6: Easy java installation & practice
Page 7: Easy java installation & practice
Page 8: Easy java installation & practice
Page 9: Easy java installation & practice
Page 10: Easy java installation & practice
Page 11: Easy java installation & practice

Eclips Just unzip the eclips file

Right click the zip file and Select extract all

Page 12: Easy java installation & practice

Open the extracted file Click this icon

Page 13: Easy java installation & practice

Eclips environment

Created packages and classes are here

Write codes here

Display the result here

Page 14: Easy java installation & practice

Write the first code inside eclips

public class FirstExample {

public static void main(String args[]){System.out.println("I am a student ");

}

}

The program will display “I am a student” as an output

Page 15: Easy java installation & practice

Learn More about JDK

Page 16: Easy java installation & practice

JDK (java development kit) It is a software development environment used for developing Java applications and applets.

It is a superset of a JRE and  javac compiler.

Page 17: Easy java installation & practice

Compiler (javac)

JVM

JRE

JDK

Source code

bytecode

Page 18: Easy java installation & practice

Compiler (javac)A compiler is a computer program that transforms source code written in a programming language into another computer language.

Java source code Bytecode

Compiler

Page 19: Easy java installation & practice

JRE (Java Runtime Environment)

JVM(Java Virtual Machine) = interpreter A (JVM), interprets compiled (bytecode) for a computer's processor (hardware)

JVM

JRE

Page 20: Easy java installation & practice

Let’s practice how it works!!!

Page 21: Easy java installation & practice

Running java code/source code via CMD

Page 22: Easy java installation & practice

Make sure if javac (java compiler) is exist. Run CMD and write these commands and click enter

Page 23: Easy java installation & practice

The result should be as the following picture

So You have java compiler!!

This is the directory where the java compiler is located

Page 24: Easy java installation & practice

Define the java compiler directory path1- Open System properties 2- Go to Advanced tab3- Click ‘Environment variables’4- Under ‘System Variables’ scroll down to find PATH. Edit the entry and add JDK path.5- Click OK and close the windows.

Note: you can copy the compiler directory in the previews picture and paste it to variable value.

Page 25: Easy java installation & practice

Change the directory. Here the source code is located on desktop.

Compile the source file via java compiler(javac)

Run the compiled file via jvm

Display the result/ output

Run test.java program in CMD