DOS Dir a Java program -HelloWorld

DOS Dir a Java program -HelloWorld

1.Java development environment to build

Install JDK 1.1

First, you need to install JDK (Java Development Kit, the Java Development Kit), now the most widely used is the 1.7 and 1.8 versions. JDK includes the JRE (Java Runtime Environment, the Java Runtime Environment), JRE included JVM (Java Virtual Machine, the Java Virtual Machine).
So only need to install a JDK can be mounted on a plate which can be as long as the record live, and then verify whether the JDK installation is successful,
the operation: Windows key + R, type cmd, and type in console Java -version, appear JDK version, the installation is successful, as shown below.

 JDK installation testing

1.2 Configuration Environment Variables

Note: Configuring an environmental variable, it is necessary to re-open a DOS window

Path system environment variable configuration:;.% JAVA_HOME% \ bin ; ( representing the current path, first look in the current path ".")
Function: to achieve can perform java.exe and javac.exe in any directory.

JAVA_HOME system environment variable configuration: C: \ Program Files \ Java \ jdk1.8.0_101
effect: When the modified release JDK installation directory, simply modify the values to JAVA_HOME variable.

1.3Hello World Source Code

public class HelloWorld {  
	public static void main(String[] args) {
		System.out.print("hello world!");
	}
}

Note: HelloWorld class name must be the same source code file name HelloWorld.java

Run shot as shown:

 HelloWorld run shot

Javac is .java compile source code -.> Class bytecode files.

Java is the JVM bytecode virtual machine file on the interpretation, execution.

Finally, add that can decompile (the bytecode .class files -.> Java source code).
Javap HelloWorld execute command DOS: Method a
Method 2: jd-gui.exe software. (Download: Link: https://pan.baidu.com/s/19JbfCTyLykki3KI22Oc45g
extraction code: 00nm)

Guess you like

Origin blog.csdn.net/lexiaowu/article/details/94745642