The Java platform is composed of
1. Compiler – It generate bytecode from source code - Bytecode is binary code that Java platform interpret
2. Java Virtual Machine – It provide runtime execution environment for bytecode.
3. Libraries – It contain Java API.
4. Tools – Various Java Tools.
The Java bytecode has two important characteristics
1. It is processor independent i.e. the program can run on any processor architecture.
2. It is Operating System independent i.e. bytecode doesn't target any Operating System such as Windows or Linux.
The Java platform is available in four flavors based upon device type.
1. Java Card – It is used in smart cards and small memory devices.
2. Java ME (Micro Edition) – It is used in Personnel Digital Assistants, Setup Box and
printers application.
3. Java SE (Standard Edition) – It is used in development of desktop, communication
and User Interface based applications.
4. Java EE (Enterprise Edition) – It is used in development of web based, messaging,
distributed and enterprise applications.
Java as Programming Language
1.Statically typed – The type of the variable is known at compile time.
2. Object-oriented – Object centered programming.
3. Concurrent – Support for multithreading programming.
Java Runtime Engine (JRE)
- The minimum environment required for a java program to run/execute is called JRE
- JRE cannot be used for development of Java application but it is used for executing them.
- JRE is composed of following components:
1.Interpreter: It understand binary java code (e.g.: java.exe).
2.Tools: They provide various functionality such as security, core services,
internationalization, RMI etc.(e.g.: keytool, rmiregistry, javacpl etc)
3.Library: Java Application Programming Interface (rt.jar, jce.jar, jsse.jar etc.)
Java Development Kit (JDK)
JDK is a super set of JRE. JDK has all the components that JRE has plus it has a compiler.
- JDK is nothing but Java Standard Edition which is used for development of java application
- JDK is composed of following components:
- Compiler: It is used to compile java code to bytecode (e.g Javac.exe).
- Interpreter: It processes bytecode to native code (e.g. java.exe).
- Library: Reusable pre-defined Java API (rt.jar, jce.jar, jsse.jar etc.)
What is PATH variable?
- Environment variables are special Windows OS variables that are dynamic in nature.
- The value of environment variable is changeable and updateable therefore environment variable is
called as dynamic.
- They contain values that can be used by programs. Environment variables are used for identify
installation directory, location of temporary files, tools and profile settings
- Path environment variable identifies the location of Java compiler and Java interpreter.
- The “PATH” variable contain the location of tools, specifically it identifies the location of
java interpreter (Java.exe), Java compiler (Javac.exe) and Java tool chain.
- “SET” command provide a complete list of all environment variables from command line.
- Control panel technique is better than command line because it is permanent.
- “SET” followed by environment variable will show value for that variable only.
PATH variable can be set in two ways using
- Command Line Setting
This technique will apply only for the current command line session.
The PATH variable can be set using SET command. The SET command is not case sensitive.
Set path= “C:\Program Files\Java\jdk1.8.0_65\bin”
Explanation: The above command will overwrite the PATH variable with the location of
JDK 1.8.Use double quotes for directory that contain space. When setting PATH variable
do not specify the name of tool only identify the location.
Set PATH = %path%; “C:\Program Files\Java\jdk1.8.0_65\bin”
Explanation: The above command will append the location of PATH variable.
- Setting PATH Using Control Pane- This is a superior way of setting PATH variable because it will be permanent.
- Start control panel -> Choose System applet.
- Click Advanced System Settings.
- . Choose advanced tab from environment variables dialog box.
- Click on Environment variables button.
- Goto Path variable in System Variables container and edit values to it.
- If PATH variable is not available then create a new PATH variable and add value to
it.