easy java installation & practice

Post on 09-Apr-2017

55 Views

Category:

Self Improvement

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

Writingcompiling and debugging a program is easy in java.

Start programming with java

Install JDK (java development kit)

Install eclips (IDE)

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

Eclips is the environment where we write the codes

JDK installation

Eclips Just unzip the eclips file

Right click the zip file and Select extract all

Open the extracted file Click this icon

Eclips environment

Created packages and classes are here

Write codes here

Display the result here

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

Learn More about JDK

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.

Compiler (javac)

JVM

JRE

JDK

Source code

bytecode

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

JRE (Java Runtime Environment)

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

JVM

JRE

Let’s practice how it works!!!

Running java code/source code via CMD

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

The result should be as the following picture

So You have java compiler!!

This is the directory where the java compiler is located

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.

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

top related