Java Tutorials
  • Introduction to Java
    • What is Java?
    • History and Features of Java
    • Java Virtual Machine (JVM) and Bytecode
    • Why Java?
  • Setting up Java Development Environment
    • Installing Java Development Kit (JDK)
    • JDK vs JRE
    • Setting up IDE (Eclipse, IntelliJ, NetBeans) or Text Editor (VS Code, Sublime Text)
  • Basic Java
    • First Java Program : Hello World
    • Variable
    • Data Type
    • Constant
    • Date and Format
    • Operator
    • Condition
    • Looping
    • Function
    • Variadic Function
    • Enums
    • Array
    • Collection
    • Exception and Exception Handling
    • Naming Convention
  • Object Oriented Programming (OOP)
    • Classes and Objects
    • Inheritance and Polymorphism
    • Encapsulation and Abstraction
  • File Handling
    • Reading and Writing Binary File
    • Reading and Writing Text File
    • Serialization and Deserialization
  • Multithreading
    • Creating and Running Threads
    • Synchronization
    • Thread Pools and Executors
  • Collections API
    • Sorting and Comparable
    • Searching and Comparator
  • Java Database Connectivity (JDBC)
    • Introduction and Life Cycle
    • Connection to Database (MySQL)
    • Downloading JDBC Drivers for Various Databases
    • Maven and Gradle JDBC Drivers for Various Databases
    • JDBC URL Formats
    • Statement and PreparedStatement
    • CallableStatement
    • Selecting Data using JDBC
    • Inserting Data using JDBC
    • Updating Data using JDBC
    • Deleting Data using JDBC
    • Invoking Function and Stored Procedure using JDBC
  • Lambda
    • Introduction to Lambda Expressions
    • Functional Interface
    • Filtering, Mapping, Reducing
    • Lambda Expressions in Collections
    • Method References
    • Functional Programming Concepts
    • Stream API
    • Error Handling in Lambda Expressions
    • Optional in Functional Programming
    • Parallel Processing with Lambda
    • Functional Programming Patterns
    • Advanced Topics in Lambda Expressions
    • Best Practices and Design Patterns
    • Real-World Use Cases and Examples
Powered by GitBook
On this page
  1. Setting up Java Development Environment

JDK vs JRE

JDK (Java Development Kit):

The JDK, or Java Development Kit, is a software development kit used to develop Java applications. It contains tools needed for Java programming, including a compiler, debugger, and other utilities. Here are its key components:

  1. Compiler: The JDK includes the Java compiler (javac), which translates Java source code into bytecode, an intermediate language that can be executed by the Java Virtual Machine (JVM).

  2. JVM (Java Virtual Machine): The JDK contains the JVM, which is responsible for executing Java bytecode. Different implementations of the JVM exist for various operating systems.

  3. Java API (Application Programming Interface): The JDK provides a rich set of pre-built classes and libraries, collectively known as the Java API, that developers can use to build applications.

  4. Development Tools: JDK includes various development tools like JavaDoc (for generating documentation), Java Debugger, and Java Archive (JAR) tools for packaging applications.

  5. Sample Code and Demos: JDK often includes sample code and demos to help developers understand how to use Java features.

Developers use the JDK to write, compile, and debug Java applications. It's a complete package for Java development, suitable for developers creating Java software.

JRE (Java Runtime Environment):

The JRE, or Java Runtime Environment, is an environment in which Java applications run. It includes everything needed to run a Java program, but it lacks the development tools found in the JDK. Here's what the JRE includes:

  1. JVM (Java Virtual Machine): Similar to the JDK, the JRE includes the JVM, allowing Java bytecode to be executed on the host system.

  2. Java API: The JRE contains the Java API libraries, enabling Java applications to access standard functionalities like input/output operations, networking, and data structures.

  3. Java Plugins: JRE includes browser plugins that enable Java applets to run in web browsers.

  4. Java Web Start: JRE supports Java Web Start, which allows Java applications to be launched from a web browser.

  5. No Development Tools: Unlike the JDK, the JRE does not include development tools such as compilers and debuggers.

In summary, while the JDK is intended for Java development, including both development and runtime components, the JRE is solely for running Java applications and lacks the development tools necessary for creating new Java programs. Developers need the JDK for creating Java applications, while end-users who want to run Java applications only require the JRE.

PreviousInstalling Java Development Kit (JDK)NextSetting up IDE (Eclipse, IntelliJ, NetBeans) or Text Editor (VS Code, Sublime Text)

Last updated 1 year ago