DEV Community

Sugumar R
Sugumar R

Posted on

Day 1: java inroduction

What is Java?

Java is a popular, high-level, object-oriented programming language designed for flexibility, security, and cross-platform compatibility. It follows the "Write Once, Run Anywhere" (WORA) principle, meaning Java programs can run on any system with a Java Virtual Machine (JVM).

Future of Java

Java has a strong future because:

  1. Continuous Updates – Oracle releases updates every six months, improving performance, security, and features.

  2. Enterprise Demand – Many companies use Java for web applications, financial systems, and backend services.

  3. Cloud and AI – Java is used in cloud computing, AI, and IoT applications.

  4. Spring Framework Growth – The Spring ecosystem (Spring Boot, Spring Cloud) keeps Java relevant in modern application development.

  5. Android Development – Java remains a key language for Android app development.

  6. Performance Enhancements – New versions bring better speed, memory management, and concurrency support.

Why Java?

  1. Platform Independence – Runs on Windows, Linux, macOS without modification.

  2. Object-Oriented – Encourages reusable, modular, and scalable code.

  3. Strong Community Support – Large developer base, making problem-solving easier.

  4. Security – Features like bytecode verification, sandboxing, and secure APIs.

  5. Rich Libraries & Frameworks – Supports enterprise applications with tools like Spring, Hibernate, and JPA.

  6. Multi-threading & Performance – Efficient for handling multiple tasks at once.

JVM, JRE, JDK, and JIT in Java

Java is a platform-independent language because of the Java Virtual Machine (JVM). Let's understand the key components:

1. JVM (Java Virtual Machine)

JVM is an abstract machine that provides a runtime environment for Java programs.

$ It converts Java bytecode into machine code that the operating system understands.

$ JVM ensures Java’s platform independence (Write Once, Run Anywhere).

$ Key Components of JVM:

$ Class Loader – Loads Java classes into memory.

$ Runtime Memory (Heap, Stack, etc.) – Manages memory for objects and methods.

$ Execution Engine – Converts bytecode to native machine code (includes JIT Compiler).

2. JRE (Java Runtime Environment)

$ JRE provides everything needed to run a Java application.

$ It includes JVM + Core Libraries (like Java APIs, RT.jar, etc.)

$ JRE ≠ JDK – JRE is only for running Java programs, not for development.

3. JDK (Java Development Kit)

$ JDK is for developers who want to write, compile, and run Java programs.

$ It includes JRE + Development tools (compiler, debugger, etc.).

JDK Components:

$ JRE – To run Java applications.

$ Java Compiler (javac) – Converts Java code to bytecode.

$ Debugger (jdb) – Helps find and fix errors.

$ Other Tools – Javadoc, JavaFX, etc.

Versions: JDK 8, JDK 11 (LTS), JDK 17 (LTS), and newer versions every six months.

4. JIT (Just-In-Time Compiler)

$ JIT is part of the JVM’s execution engine.

$ It converts bytecode into native machine code at runtime for better performance.

$ Instead of interpreting bytecode line by line, JIT compiles frequently used code into machine code, making execution faster.

Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay