Introduction to java
This is the first blog of the series "Get Started with JAVA".
In this blog, we will cover the introduction of Java programming. We will also see the understanding of Java's tagline WORA
Write once, Run anywhere
I will cover the following topics
Introduction
History
WORA
Advantages/Application of Java
Installation of Java
Introduction:
Java is a high-level, class-based(object-oriented programming language) that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, and run anywhere (WORA).
As of 2019, Java was one of the most popular programming languages according to GitHub
History:
Before we start learning Java let's first dive into the history of it.
Java was released in May 1995 by Sun Microsystem. It was originally developed by James Gosling. The original implementation, compiler virtual machines and class libraries were released by Sun under proprietary licenses. Then after Sun relicensed it under a GPL-2.0-only license.
Oracle offers its own HotSpot Java Virtual Machine, however, the official reference implementation is the OpenJDK JVM which is free open-source software used by most developers and is the default JVM for almost all Linux distributions.
FUN FACT:
Java was originally designed for interactive television, but it was too advanced for the digital cable television industry at the time.
The language was initially called Oak after an oak tree that stood outside Gosling's office.
Later the project went by the name Green and was finally renamed Java, from Java coffee, a type of coffee from Indonesia
There were five primary goals in the creation of Java:-
It must be simple, object-oriented, and familiar.
It must be robust and secure.
It must be architecture-neutral and portable.
It must execute with high performance.
It must be interpreted, threaded, and dynamic.
WORA:-
Write Once, Run Anywhere
is the main goal of Java creation. It states that Java is platform-independent means you can run your code on any machine which has JDK (Java Development Kit).
It's one of the main advantages of java that it doesn't depend on the platform. You can run your Java code in any os whether it's Windows, Linux or any other operating system.
Advantages and application of Java:-
The following are the main advantages of Java over other languages:-
Straightforward:- Java might be a more modest sum convoluted than C++; therefore, it utilizes programmed memory portion and trash assortment.
WORA:- It can run on any machine which has JDK or JVM(Java Virtual Machine)
Object-oriented:- It grants you to make standard projects and reusable code.
Secure:- It has no unequivocal pointer. Besides this, it is a security administrator that characterizes the entrance of classes.
Multithreaded:- It supports multithreading, meaning it can perform numerous assignments simultaneously.
It gives an automatic garbage collection system.
Following are the work area or applications where Java is useful:-
Mobile Applications
Desktop GUI Applications
Web-based Applications
Enterprise Applications
Scientific Applications
Gaming Applications
Big Data technologies
Business Applications
Distributed Applications
Cloud-based Applications
These are a few of them, there are more applications of Java.
Installation of Java:-
the installation process is straightforward and doesn't require any advanced technical skills. Here's a brief guide to help you install Java on your system.
First, visit the official Oracle website, where you can download the Java Development Kit (JDK). Make sure to select the appropriate JDK version for your operating system (Windows, macOS, or Linux).
Once the JDK download is complete, locate the downloaded file and run the installer.
The installation wizard will guide you through the process step by step. Follow the on-screen instructions, such as accepting the license agreement and selecting the installation directory.
Note: - By default, the JDK will be installed in the recommended location, but you can choose a different directory if needed.
After the installation is complete, you'll need to set up the environment variables. This step ensures that your system recognizes the Java installation.
On Windows
:-Go to the Control Panel and open the System properties.
Then, navigate to the Advanced tab and click on the "Environment Variables" button.
In the "System Variables" section, find the "Path" variable and click on "Edit".
Add the path to the bin directory of your Java installation (e.g., C:\Program Files\Java\jdk1.8.0_251\bin) to the list of paths.
Click "OK" to save the changes.
macOS or Linux
:-
Open a terminal window and enter the following command
export PATH=/path/to/java/bin:$PATH
- Replace "/path/to/java" with the actual path to your Java installation directory.
To verify that Java is successfully installed, open a new terminal or command prompt window and type:
java -version
If Java is installed correctly, you should see the version information displayed in the terminal.
If it's still not working you can refer to the official documentation of Oracle.
Congratulations! You have successfully installed Java on your machine. ๐๐
You can install your preferred IDE(Integrated Development Environment) to write code. here are some popular IDEs:-
Eclipse :- Eclipse Desktop & Web IDEs | The Eclipse Foundation
IntelliJ IDEA:- IntelliJ IDEA โ the Leading Java and Kotlin IDE (jetbrains.com)
Visual Studio Code: - Visual Studio Code - Code Editing. Redefined
PyCharm: - PyCharm: the Python IDE for Professional Developers by JetBrains
Thank you for reading. Follow for more ๐. For any query you can ask me via DM on twitter @navdiya_nikunj or you can connect with me on linkdn Nikunj Navdiya.