This is simple, and for beginners who want to learn Java, we will be covering all the things that you should know about Java and how to use Java. We try to understand all the basic concepts and codes to design some mini-projects.
Before starting, you should know that sometimes you may find complexity, so it is advised that you follow step by step. Also, Java doesn’t have pre-existing libraries, and it’s a competitive coding language as well as a fast language. So let’s begin the learning.
Install the Java Development Kit.
This is the first step. You need to download and install Java on your system. It is available across major platforms, including Windows, Mac, and Linux. Click on the download button below to go to the JDK Download page and download Installer according to your system preference.
If you encounter any errors while installing or have problems with the current version, you can downgrade or use the JDK Beta.
- After downloading the JDK package, double-click on it to initiate the installation.
- Confirm the UAC (User Access Control) by pressing Yes, and then click on Next.
- After that, it shows the installation location, which you can either change or let remain the default.
- Click on Next, and it will start processing the installation.
- To finish, click on Close.
After the installation is complete, you must download an editor to begin writing code. There are multiple editors available to use, like eclipse, apache, IntelliJ, and more. We will be using IntelliJ as a Java editor.
Download and install IntelliJ.
There are two different versions available. One is for web and enterprise development, and since we are just starting, we will be downloading the community. The Ultimate version is paid, and the Community version is available for free. It is available across platforms, including Windows, Mac, and Linux, based on the preference to download IntelliJ.
- Double-click on it to start installation, and then click on Run.
- Click on Yes on UAC to allow unknowing source installation.
- Click on Next, and then it will ask for the destination folder, which you can either change or let remain by default.
- Choose Java, and then click on Next.
- It will start installing. Once it finishes, you can start using IntelliJ.
Setup IntelliJ
- Open IntelliJ, and then open the T&C. After reading it, check the checkbox for “I confirm that I have read and accept the terms of this user agreement.”
- Then, click on Continue, and then on the Data Sharing page, choose Don’t Send.
- On Next Screen, open IntelliJ.
Create Project
Now we are starting to design a new project, so let’s begin.
- Click on New Project.
- It will open the new project. Give your project a name. Choose the Destination Folder to save your project. Choose the language Java, and Build System IntelliJ, JDK will automatically be selected based on the installation package. Don’t forget to check the checkbox for Add Sample Code.
- Click on Create, and it will open the editor page. ** Generally, IntelliJ is referred to as IDE.
- Close the tip, and then to start writing code, you have to open the file named Main.
- On the left sidebar, expand the SRC directory, and under it, find Main.
- You can also place it under Package Name. For this, right-click on the SRC and choose New, then Package.
- Give it a name, like com.androiodgreekjavalearning. All the related files are stored under a package, like a book shelf in a library with a specific book.
- Now, drag the main file under the package area.
- Click on Refactor to move and confirm your action.
- Once your file is done moving, or you can let it remain under SRC, there shouldn’t be any issue.
- Double-click on Main File, which appears under the Package or Src directory. This is the file that is created to write code.
So, now you have to finish setup and basic things to complete before writing code. You can learn more about learning with the following link mentioned down below. Jump into your learning accordingly.
We are open to feedback, and we try to improve the article by updating, commenting, and sharing your feedback in the comment section down below.