JAVA/JSP Learning Series One _php Foundation

Source: Internet
Author: User

First, the preface

The JDK (Java Development Kit) is the foundation of all Java applications, so you can say that all Java applications are built on this. It is a set of APIs, or some Java Class. The latest version, now officially released, is JDK1.3. Given that I'm unfamiliar with Linux and most of it is under MS, I'm using Win2000 here.

Second, download, install

Download address for Java official site: java.sun.com, the country is also everywhere.

Under Windows, run the. exe file directly, install to a directory, I use F:JDK13 as an example here.

Third, the configuration

Select My Computer on the desktop (right)

Senior

Environment variables

In the system variable---> NEW

Enter in the variable name: CLASSPATH, enter the value of the variable:

F:jdk13libdt.jar; F:jdk13libtools. JAR; F:jdk13bin; then determine;

OK, the configuration is over, the environment variable will be valid after you restart the computer.

Four, test

(1) Write a simple Java program with a text editor:

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 show "Hello World".

Note: This file name must be "Helloworld.java" and case sensitive. A careful friend will notice the same name as the one after the public class.

(2) Compile: Execute at DOS command prompt: (note case)

Javac Helloworld.java

If normal, the Helloworld.class file will be generated.

(3) Run: Execute at DOS command prompt: (note case)

Java HelloWorld

Here is a problem that Java beginners are likely to encounter (not afraid of jokes, I am also) is input:

Java Helloworld.class

More than the back of the. class, be sure to note that the following error will occur:

Exception in thread ' main ' Java.lang.noclassdeffounderror:helloworld/class

(I guess, is not the Java translation "." The time changed to "/", or other reasons I do not know

Well, running the Java HelloWorld should be a great "Hello world".

At this point, you have successfully configured the JDK to start long and painful (for like me, previously did not understand Java friends, can use the "pain" to describe, not understand the concept of unfamiliar Java API ..., but, do not worry, I will be with you slowly get started, slowly 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.