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

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.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.