Java open the door

A .Java Language Overview

  Java language was born in 1995, introduced by Sun Microsystems. In 2009, Sun was acquired by Oracle, so we can now access the oracle official website: co-founder //www.oracle.com Java language:: https James Gosling (James Gosling), is called "Java father. " Java language is powerful, easy to use, there are a lot of features, which cross-platform (portability) is a notable feature, known as "compile once, run many." How java language cross-platform?   

2: Introduction of the Java programming environment

  Java program is not run directly, the Java compiler will compile the source code into Java byte code file (class files) and platform-independent bytecode file and then interpreted by the Java Virtual Machine (JVM) execution. Therefore, under different operating systems, simply install a different cross-platform Java virtual machine can be realized java program.

  JVM (Java Virtual Machine), Java Virtual Machine JRE (Java Runtime Environment), Java runtime environment, including the JVM and Java core class libraries (Java API) JDK (Java Development Kit) called Java development tools, including JRE and development tools summary: we just need to install the JDK, which includes java runtime environment and virtual machines. JDK in the official website to download oracle can select different versions according to different systems. Currently requires that all participants use the version information on packages. installation. Fool installation, the next step can be. Recommendation: Install the path do not include Chinese and spaces. All the best development tools installation directory unified, easy to manage. For example: all development-related software is installed to the D: \\ develop directory.

III. The first demo

  Father of Java in 1995 and win the first code "HelloWorld" declared the birth of a new computer language, therefore, was the first programmer to knock code is "HelloWorld", is trying to copy. Java developers run Process:

1. Write a program;

2. Compile program;

3. Run the program;

Case HelloWorld implementation steps:

   New text document, change the name to HelloWorld.java use Notepad to open HelloWorld.java, programming content, just follow the current teacher of the code can be copied. Save the file, open a command line window, change the directory to the directory where the java file, compile and execute. Compile command: javac HelloWorld.java run the command: java HelloWorld

public class HelloWorld {

public static void main(String[] args) {

System.out.println("HelloWorld!");

}}

 

Guess you like

Origin www.cnblogs.com/cjhome/p/11228729.html