Before learning Java, you should know these knowledge (newbies must learn)

        The Java language is widely used to write web applications, mobile development, Android development, etc. There is a great demand for Java talents in the market. According to data, the salary of Java engineers is gradually increasing with the demand of the talent market. It can be seen that Java The demand for talents is showing a continuous upward trend, and the supply exceeds the demand. Its relevant application scenarios are as follows:

Another important reason why Java is so popular is that its features support cross-platform operations:

This has also led to serious introversion in the Java industry. If you are not a person with special self-control, I suggest you try other directions. If you are, please remember: Persistence is the only way to succeed, encourage each other !

Table of contents

Introduction to the History of Java

Download and install JDK

aware of:

Uninstall:

download:

Install:

Configure environment variables:

Choice of Java tools

The first Hello World in Java development life


Introduction to the History of Java

Java is a programming language developed by James Gosling (the father of Java) and his team of SUN in 1991. The first version took 18 months and was originally named Oak (an oak tree). Java is now widely used in various large-scale Internet applications. The original motivation for its design is mainly the need for a platform-independent (that is, architecture-neutral) language, which can be embedded in various consumer electronic devices (household appliances, etc.), but the market response is not good. .

With the development of the Internet in the 1990s, SUN saw the application scenarios of Oak on the Internet, and changed its name to Java in 1995 (the English name of Java Island in Indonesia, famous for its rich coffee). With the rise of the Internet, Java gradually called Develop languages ​​for important web applications. The development of Java can mainly see the development of JavaWeb, and Java has also witnessed the development process of the Internet.

So far, Java is not only a programming language, but also a technical system composed of a series of computer software and specifications. Java is the basis of almost all types of network applications, and is also the basis for developing and providing embedded and mobile applications, games, The global standard for web-based content and enterprise software.

From laptops to data centers, from game consoles to scientific supercomputers, from mobile phones to the Internet, Java is everywhere!

Download and install JDK

When it comes to Java, it is naturally inseparable from JDK, JVM, and JRE. What is the relationship between the three.

aware of:

JDK (Java Development Kit): It is a Java program development kit, including development tools such as JRE and compiler.

JRE (Java Runtime Environment): It is the runtime environment of the Java program, including the class library required by the JVM and runtime.

JVM (Java Virtual Machine): It is a Java virtual machine, a virtual computer that runs all Java programs, and an operating environment for Java programs. It is one of the most attractive features of Java. The Java code we write runs on it.

The relationship between the three is as follows: JDK > JRE > JVM

Uninstall:

Before knowing how to install, you should know how to uninstall. If you have installed a lower version of JDK before, you can try to uninstall and reinstall a higher version of JDK. If you are downloading JDK for the first time, you can skip the uninstallation explanation. The specific process as follows:

Right-click This Computer -> Properties -> Advanced System Settings -> Environment Variables, and find the path of the JAVA_HOME setting as follows.

Delete the corresponding folder on the path , and then delete the "JAVA_HOME" and "CLASSPATH" system variables.

Then delete the content related to java under the editing system variable Path:

Next, go to Control Panel >> Uninstall a program >> Uninstall Java-related programs, as follows:

This deletion method has a high probability of retaining some information in the registry and cannot actually delete it. It is recommended to delete the tool geek to uproot the information in the registry, as follows:

To verify whether the deletion is successful, enter the command: java -version on the cmd command line. If the following information appears, the uninstallation is successful.

download:

First of all, let's go to the official JDK download website, URL: https://www.oracle.com/downloads/ , scroll down the page, find the location of the Java icon and click to enter.

Then, we click Java (JDK) for Developers, as follows:

You can download the JDK on the current page. There are two main options, depending on your choice:

Because the encoding format used by JDK18 is GBK, you will find Chinese garbled characters when writing the program output. The version before JDK18 is in UTF-8 encoding format, so here I use JDK17 version. Of course, it depends on personal choice. Even if you choose version 18, there is a solution The method of Chinese garbled characters will not be repeated here. Select the JDK you want to install as follows (here I choose window, let’s look at the personal computer):

There are three options here, and the differences between them are as follows :

Zip compressed package: no installation is required, it can be run after decompressing it into a folder and putting it in the specified path.

exe installation package: it is an installation program, we need to manually set the path for installation, and it can only be run after the installation is successful.

The msi data package encapsulates all the content related to the installation file in one package.

Personally, I still like to lie flat, so I decisively choose to install the program manually (doge)

Install:

Find the JDK installer we downloaded earlier, and double-click to run the installation package we just downloaded:

Here I suggest not to put it in the c drive of the default path, you can change it to the d drive, note : the download path cannot appear in Chinese! ! !

ok, the following interface appears to indicate that the installation is complete, click to close:

After the download is complete, you will get the following folders under the installation path you downloaded, as follows:

bin: Various tool commands are stored in this path, among which javac and java are more important

conf: relevant configuration files are stored in this path

include: Some platform-specific header files are stored in this path

jmods: Various modules are stored in this path

legal: This path stores the authorization documents of each module

lib: Some supplementary JAR packages of the tool are stored in this path

Configure environment variables:

Similar to deleting the JDK above, open the environment variable, find the system variable, click the New option, and enter the following:

Select the path option in the system variable, click Edit to enter the edit page, and paste the following content into it:

%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

JDK authentication configuration:

Whether the JDK is successfully installed, we still need to do some verification, win + r, enter cmd, and enter the following content in the pop-up terminal, if the results appear, the installation is successful, as follows:

Choice of Java tools

If you plan to move to the Java industry, a good tool can accompany you all your life and spend every day and night with you. I don’t have much advice on the choice of tools. It just depends on your personal preferences for editors. The main editor used is IntelliJ IDEA, the abbreviation is: IDEA. The mainstream Java development tool is now none other than IntelliJ IDEA. A few years ago, Eclipse might still be able to compete with IDEA, but now it is basically dominated by IDEA. So I suggest you choose this editor, and many Java developers are keen to use it now.

Tool download website: https://www.jetbrains.com/idea/download/#section=windows , if you have financial strength, you can download the commercial version, if not, you can also choose the community version to meet your daily learning needs enough.

The specific installation process will not be repeated here, and the fool-like installation is enough. After the installation of IDEA is completed, we can simply configure the tool to facilitate future code writing operations, as follows:

After you have just installed the IDEA tool, the following interface will appear when you start the tool for the first time. Select the plug-in option. The first plug-in I installed here is the Chinese language pack. Of course, if your English is good enough, you can understand it. All configuration information on the tool can ignore this step:

After installing the Chinese plug-in, if there is no project, you can choose to create a new project, as follows:

Just do the following configuration:

Of course, you can also choose the theme plug-in developed by your own editor. My personal favorite plug-in is Dark purple. For detailed plug-ins, you can click the following options to choose:

The first Hello World in Java development life

Guess you like

Origin blog.csdn.net/qq_53123067/article/details/129231823