Java/jsp Learning Series

Source: Internet
Author: User


I. Preface

JDK (Java Development Kit) is a Java application.ProgramIt 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: 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 the JDK, and it can start to be long and painful (for friends like me who didn't know Java before, it can be described as "painful", a concept that you don't understand, or a Java API that you are not familiar ..., however, don't worry. I will get started with you and gradually improve ......) java Process. (Source: viphot.com)

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.