One of the JAVA/JSP Learning Series (JDK installation )-
Source: Internet
Author: User
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
The download address is 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: JDK13LIBdt. JAR; F: JDK13LIBTOOLS. JAR; F: JDK13BIN; 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.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.