What does it mean to build Java?
Publication Date:January 11, 2021
INFOMARTION > What does it mean to build Java?
summary
If you are developing applications using Java, you have probably heard the term "build Java" at least once, but I would like to explain what exactly it does.
Table of Contents
1. What is Build Java?
Building Java" refers to the process of making Java executable. Java cannot be executed simply by writing a program as follows
public class HelloWorld{
public static void main(String[] args){
System.out.println("Hello World!!");
}
}
Normally, you would write a program for a file with a ".java" extension, but when Java is actually executed, it is a ".class" file. In other words, ".java" is converted to ".class" and Java executes the ".class" file. I often see people saying, "I modified the Java file, but it is not reflected." In many cases, the Java file has been modified but the class file has not been modified.
The process of making Java executable refers to the process of converting this ".java" file into a ".class" file. In more detail, the process of converting a ".java" file into a ".class" file and stringing the converted ".class" file together is called building.
1-1. Why build?
The reason for building is to convert the file to a ".class" file, which is a file format in which Java can be executed. The ".class" file contains machine-readable content and is not a human-readable file. Java is executed in a machine-readable file format, i.e., a file that has been converted to a format that can be processed quickly by a machine, so that Java is processed at high speed.
1-2. What is Compilation?
In understanding builds, it is also necessary to understand "compilation". Compilation is the process of converting a ".java" file into a ".class" file in the build process. Build, as explained earlier, refers to the following two tasks
- Conversion of ".java" files to ".class" files
- Work to tie the converted ".class" files together
The process of converting a ".java" file into a ".class" file is called compilation.
3. summary
The three points are as follows
- Build is the process of making Java ready to run.
- Build is compiling and tying class files together.
- The file that is actually executed when Java is run is a ".class" file extension
Thank you for taking the time to read this to the end.
■INFORMATION
Please click here to go to the top page of INFORMATION.
■PROFILE
Please click here to view the profile.
■For inquiries, please contact