new stage, New beginning, today began to enter the Java world. Java, the word, can say that they are not unfamiliar. Even if you have not personally touched, but at least, in the mind, has already had its piece of storage space. If I ask what is in this space, my answer is nothing. But, from today on, it will be more and more abundant and bigger here. I. The development of the Java language background language can be broadly divided into three stages: First generation language: pure Machine Language second generation language : assembly language The third generation of languages: " Programming language ". the computer, which has been studying for so long, also touches many programming languages. From the very beginning of the object-oriented, process based VB language, to the later process-oriented, object-oriented C + + language;. NET language platform; now, the Java language to learn is a purely object-oriented language. Two. The features of the Java language are concise, the features are mainly thefollowing three points: 1. An object-oriented language 2. A platform-independent language that provides an interpretation environment for running the program3. A robust language that absorbs the advantages of C + + and C, but removes the parts that affect the robustness of the program (pointers, memory requests, and releases)three. Java Core mechanism1. Virtual machine, eliminate platform limit, realize "compile once, run anywhere".2. Garbage collection eliminates the responsibility of the programmer to reclaim useless memory space and run automatically during the run.four. Java's first programEvery time you broaden your horizons, there is always a simple and classic little program. Here, once again with Hello World, but not the same environment, not the same language, carrying the same hello, we see.1. Installing the Java EnvironmentIn this process, there are two times the process of selecting the installation path, one is the JDK, and the other is the JRE.The JDK (Java Development Kit), which is intended for use by developers, provides a Java development environment and a running environment. SDK (software Development Kit) software Development Kit, including function libraries, compiler programs, and more.JRE (Java runtime enviroment), which refers to the Java Runtime Environment, is intended for users of Java programs, not developers. The JRE is like a PC, and the application requires the operating system to run it, and the Java program we write must also have the JRE to run.It is important to note that, these two times shouldchoose a different installation path, otherwise the original JRE file in the JDK directory will be overwritten, resulting in the inability to find the Javac.exe program.2. Check the Java environmentTo check if your Java environment is properly installed, you can enter java-version under the cmd command. If the installation is correct, you will see the version number you installed, such as:If the environment is not installed correctly, you will be prompted:This will require a second look at whether you have installed the Java environment correctly.3. Writing Program codeI created a new Java folder on D, where I created a new text file and wrote the following code:
public class Helloworld{public static void Main (String [] args) {System.out.println ("HelloWorld");}}
Note: The file should be saved asJava file Types, the file type under the WIN8 system does not change with the change extension.4. Running the programFollow the footsteps of the video, finally wrote the first Java program, step by step, already can't wait to see the results. However, it is not so smooth, wrong ...Internet search, everywhere is the problem, get an answer is about the environment variable answer.It may be that you have changed the installation directory, and there are no errors that result from changing the value of the path variable under the system environment variable. So, it's simply that you just need to change the path value on the line.Win8 system, we just need to find "computer-right-click Properties-Advanced System Settings-select environment variable-find PATH variable" and change its value to its own corresponding installation directory:5. Meeting with HelloWorldProblem solved, also finally saw HelloWorld.five. First Touch Java ExperienceAnyway, this is your first time in the Java environment. Before always heard, heard always feel tall on, this time personal contact, really saw a different environment, more feel tall on.The first time to write Java program, although simple, but learned a lot, through their own problems, is also found a lot of things, see the broader sky.This is just the beginning, I want to shout: Java,i ' m coming~
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
"Java" Hello World