Home > Backend Development > PHP Tutorial > JAVA/JSP Learning Series One_PHP Tutorial

JAVA/JSP Learning Series One_PHP Tutorial

WBOY
Release: 2016-07-21 16:11:42
Original
838 people have browsed it


1. Foreword

JDK (Java Development Kit) is the foundation of all java applications. It can be said that all java applications are built on this. It is a set of APIs, which can also be said to be some java Classes. The latest version that has been officially released is JDK1.3. Considering that I am not familiar with Linux and most of them are under MS system, I use win2000 here.

2. Download and install

The download address is the official JAVA site: java.sun.com, which is also available everywhere in China.

Under Windows, run the .exe file directly and install it into a directory. I use F:jdk13 as an example.

3. Configuration

Select "My Computer" on the desktop (right click)

Advanced

Environment variables

In "System Variable"--->"New"

In the variable name: CLASSPATH, in the variable value:

F:JDK13LIBdt.JAR;F:JDK13LIBTOOLS.JAR;F:JDK13BIN ;Then confirm;

Okay, the configuration is complete. The environment variables can only be effective after restarting the computer.

4. 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 famous "Hello World", its function is to display "Hello World".

Note: The file name must be "HelloWorld.java" and is case-sensitive. Careful friends will notice that it is the same as the name after public class.

(2) Compilation: Execute in dos command prompt: (note the case)

javac HelloWorld.java

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

(3) Run: Execute in dos command prompt: (note the case)

java HelloWorld

Here is a java beginner who is likely to encounter The problem (I’m not afraid of jokes, neither am I) is to type:

java HelloWorld.class

There is an extra .class at the end, be sure to pay attention, otherwise the following error will occur:

Exception in thread 'main' java.lang.NoClassDefFoundError:HelloWorld/class

(I guess, whether java changed "." to "/" when translating ".", or something else I don't know Reason)

Okay, running java HelloWorld should bring up the great "Hello World".

At this point, you have successfully configured the JDK, and you can start the long and painful process (for friends like me who did not understand Java before, it can be described as "painful", and those who do not understand Concept, unfamiliar java api..., but don't worry, I will slowly get started with everyone and slowly improve...) Java process. (Source: viphot.com)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/313870.htmlTechArticle1. Introduction JDK (Java Development Kit) is the foundation of all java applications. It can be said that all java applications The program is built on top of this. It is a set of APIs, or some...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template