Intro to Java and Environment Setup
The course is part of this learning path
In this course, we learn about Java technology and get you started with writing and running a Java program.
- What is the Java programming language?
- Java Development Kit (JDK)
- Java Runtime Environment (JRE)
- Java Virtual Machine (JVM)
- Integrated Development Environment (IDE)
- Installation of Eclipse
- Write a Java program
- compile and run a Java program
- Anyone looking to get Oracle Java Certification
- Those who want to learn the Java Programming language from scratch
- Java developers who want to increase their knowledge
- Beginners with no previous coding experience in Java programming
- Those who want to learn tips and tricks in Oracle Certified Associate – Java SE 8 Programmer certification exams
- No prior knowledge is required about the Java programming language
- Basic computer knowledge
Hi there. In this lesson, we'll prepare our computer to write code in order to develop programs using the Java programming language. For this, we will first install the Java Development Kit, (JDK). Earlier, we said that the Java language runs on the Java virtual machine. Therefore, in order to develop applications using the Java language, we need to install JDK on our computer. Yes, after this brief information, let's move on to the JDK installation now. First, we open our web browser. I use Google Chrome, but you can use any browser you want. Now, let's write the "download jdk" in the search bar. After pressing the 'ENTER' key, I open the first of the results, namely, the 'Java Downloads Oracle' page.
If you notice, the most up-to-date version of Java is Java 18 and it is available. But we will install the Java 8 for the Java Standard Edition 8 Certificate course. For this reason, I will click the 'Java Archive' tab here. I will scroll down this page, and as you can see, all versions of the Java is here. We will install the 'Java SE 8(8u211) and later version. So, I click here. I will scroll down this page, and under the 'Java SE Development Kit 8u331' title, we can see the download options of the JDK 8. From here, we can download the appropriate JDK for our computer. As you can see, there are JDK installation files for Linux, Mac, and Windows operating systems. My computer has the Windows 64-bit operating system. At this point, I want to point out, if you do not know your computer's operating system and how many bits, you can find out as follows.
We click on the 'Windows' icon in the lower left corner, then we open the 'Settings' application. In the window that opens, I click the 'System' tab. When you select the 'About' option at the bottom of the window that opens, the window containing the basic properties of the computer will open. From this window, you can find out your operating system and how many bits it is. Now, let's continue where we left off. Since my operating system is Windows 64-bit, I chose the 'jdk-8u331-windows-x64.exe' option from here. As you can see, the download has started. Also, at this stage, a popup may open asking you to confirm the license agreement. You must confirm the agreement to continue. The download may take some time depending on your Internet speed. Therefore, I'm stopping the screen recording here and when the download is complete, we will continue where we left off.
Yes guys, the download is complete. I click on the 'Arrow' icon right here and select the 'Show in folder' option. As you can see, we have obtained a .exe file. Now, we'll run this file. So, I right click and select the 'Run as administrator' option. At this stage, the Windows operating system gives a warning such as, do you want to run this file? I click the 'Run' button. This warning may not appear for you, not important. As you can see, the setup wizard was opened, I click the 'Next' button. In this window, it shows us the path of the file where the JDK will install. I click the 'Next' button once again without changing this, and the installation process has begun. This process may take some time. It also shows the path to the file where the JDK will be installed once again. I click the 'Next' button once again, and the JDK installation started.
Installation may take some time. You should wait for the installation to finish before doing anything. And as you can see, the JDK installation is complete. Now, I will close this window. And let's open program files by selecting 'This PC' and 'Local Disk (C:)' options. As you can see, there is a Java folder. This file did not exist before installation. When the installation is complete, this file is created and the necessary files are collected under the Java file. And I will open the Java folder. As you can see, there are jdk and jre folders. Yes, so, we installed the JDK on our computer successfully. But we have one last step to do. We need to define the path of the java.exe file in the jdk folder here to the operating system. For this, I open the jdk folder. I also open the bin folder.
Now, let's find the java file here. Yes, I found the java file. Now, let's define the path of this file to the system. By the way, these steps are valid for those with Windows operating system. You do not need to perform these steps for Mac or Linux operating systems. Firstly, I click on the address bar at the top of the window and copy the file path here by pressing the 'CTRL' and 'C' keys on the keyboard. Now, let's define this file path to the system. I right click on 'This PC' from the left side and select the 'Properties' option from the dropdown menu. From this window that opens you can learn basic information about your operating system.
Now, I select the 'Advanced system settings' option on the right. I select the 'Environment Variables' option from the 'System Properties' window that opens. If you notice, there are two different sections here. We will use the bottom section, namely the 'System variable' section to define the JDK for the system. After selecting the 'Path' option from the section here, I choose the 'Edit' option. Here, we'll paste the path to the java file in the bin folder. For this, I click the 'New' button and paste the file path we just copied by pressing the 'CTRL' and 'V' keys on the keyboard in this field that opens.
Thus, we have defined the jdk file for this system. The meaning of this process is as follows. If you want the operating system to run Java, the operating system has to know where the java.exe file is. Otherwise, it cannot run Java. For this reason, we have defined the folder where the java.exe file is located in the operating system. Finally, I click the 'OK' button. I click the 'OK' button once again. Also, we can check the Java version from the Command Prompt. I click the search bar here and type the 'command prompt' and open the Command Prompt. Here, I write 'java' and after a space, I write '-version' and click 'ENTER'. If everything goes right you will see the version of Java. Congratulations. Yes friends, we have completed the JDK installation. Let's take a short break here if you want. In our next lesson, we talk about the Integrated Development Environment, IDE. See you in the next lesson.
OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.