I. Preface
JDK (Java Development Kit) is the basis of all java applications. It can be said that all java applications are built on this. It is a set of APIS, or java Class. The latest version JDK1.3 has been officially released. Considering that I am not familiar with linux, and most of them are in the MS system, here I use win2000.
Ii. Download and install
JAVA official site: java.sun.com, which is everywhere in China.
Run the. exe file directly in windows and install it in a directory. Here I use F: \ jdk13 as an example.
Iii. Configuration
Right-click my computer on the desktop)
Advanced
Environment Variable
Go to "system variables" ---> "new"
Enter CLASSPATH in the variable name, and enter the following in the variable value:
F: \ JDK13 \ LIB \ dt. JAR; F: \ JDK13 \ LIB \ TOOLS. JAR; F: \ JDK13 \ BIN; then confirm;
Okay. After the configuration is complete, the environment variable will be valid only after the computer is restarted.
Iv. Test
(1) Use a text editor to write a simple java program:
Public class HelloWorld {
Public static void main (String args []) {
System. out. println ("Hello World! ");
}
}
This example is the famous "Hello World". Its function is to display "Hello World ".
Note: The file name must be "HelloWorld. java", which is case sensitive. Careful friends will notice that the name is the same as that after the public class.
(2) Compile: Execute at the doscommand prompt: (case sensitive)
Javac HelloWorld. java
If normal, the HelloWorld. class file will be generated.
(3) Run: run the command at the doscommand prompt: (case sensitive)
Java HelloWorld
Here is a question that is very likely to be encountered by beginners of java (not afraid of jokes, I am also:
Java HelloWorld. class
Pay attention to the later. class. Otherwise, the following error will occur:
Exception in thread "main" java. lang. NoClassDefFoundError: HelloWorld/class
(I guess it is because "/" is used in java translation ".", or is it because I do not know it)
Well, running java HelloWorld should have a great "Hello World.
At this point, you have successfully configured JDK, and it can start to be long and painful (for those who do not know java before, like me, they can be described as "painful, concepts that you don't understand, unfamiliar java APIs ..., however, don't worry. I will get started with you and gradually improve ......) java Process.