Introduction to Java
Sujit Kumar
Zenolocity LLC
Java Eco System
• Java Language
• Java Development Kit (JDK)
• Java Runtime Environment (JRE)
What is JDK?
• Java Development Kit (Development Tools + JRE )
• Contains tools to develop java programs and a
JRE to run the java programs.
• Tools include:
1. Compiler (javac)
2. Java Application launcher (java)
3. Debugger (jdb)
4. Generate Java Documentation (javadoc)
Most Important Features of Java
•
•
•
•
•
•

Portable (Write Once, Run Anywhere)
Interpreted
Object Oriented
Distributed
Secure
Scalable
Portable – Write Once, Run Anywhere
• In Java, compilation of source code produces
machine independent byte code that can run
on any OS or hardware that has a JVM.
• JVM interprets this byte code and converts to
machine dependent executable code.
• In C/C++, compilation of source code produces
machine dependent executable code. Source
code needs to be recompiled for every OS or
hardware.
What is JRE?
• JRE = JVM (includes JIT) + class libraries
• No development tools like compiler, debugger.
• JVM actually runs the program. JVM is called virtual
because it provides an interface that does not depend
on the underlying operating system and hardware.
• Every vendor of a hardware platform provides a
platform specific JRE.
• JRE is platform dependent, byte code is platform
independent.
• Java application launcher (java) opens a JRE, loads a
class and invokes its main method.
JIT Compiler
• The byte code is compiled when it is about to
be executed (hence the name "just-intime"), and then cached and reused later
without needing to be recompiled.
• In contrast, a traditional interpreted virtual
machine will simply interpret the byte
code, generally with much lower performance.
JDK, JRE, JVM, JIT
Compare Java to C/C++

Introduction to java

  • 1.
    Introduction to Java SujitKumar Zenolocity LLC
  • 2.
    Java Eco System •Java Language • Java Development Kit (JDK) • Java Runtime Environment (JRE)
  • 3.
    What is JDK? •Java Development Kit (Development Tools + JRE ) • Contains tools to develop java programs and a JRE to run the java programs. • Tools include: 1. Compiler (javac) 2. Java Application launcher (java) 3. Debugger (jdb) 4. Generate Java Documentation (javadoc)
  • 4.
    Most Important Featuresof Java • • • • • • Portable (Write Once, Run Anywhere) Interpreted Object Oriented Distributed Secure Scalable
  • 5.
    Portable – WriteOnce, Run Anywhere • In Java, compilation of source code produces machine independent byte code that can run on any OS or hardware that has a JVM. • JVM interprets this byte code and converts to machine dependent executable code. • In C/C++, compilation of source code produces machine dependent executable code. Source code needs to be recompiled for every OS or hardware.
  • 6.
    What is JRE? •JRE = JVM (includes JIT) + class libraries • No development tools like compiler, debugger. • JVM actually runs the program. JVM is called virtual because it provides an interface that does not depend on the underlying operating system and hardware. • Every vendor of a hardware platform provides a platform specific JRE. • JRE is platform dependent, byte code is platform independent. • Java application launcher (java) opens a JRE, loads a class and invokes its main method.
  • 7.
    JIT Compiler • Thebyte code is compiled when it is about to be executed (hence the name "just-intime"), and then cached and reused later without needing to be recompiled. • In contrast, a traditional interpreted virtual machine will simply interpret the byte code, generally with much lower performance.
  • 8.
  • 9.