Build a Java environment

Source: Internet
Author: User
The establishment of the Java environment-general Linux technology-Linux programming and kernel information. The following is a detailed description. To run a Java program, you must install JDK. JDK is the core of Java, including the Java compiler, JVM, a large number of Java tools, and Basic Java APIs.

JDK 1.4 and 1.31 can be downloaded from the http://Java.sun.com. In my learning environment, Version 1.31 is used first.

Decompress and install. Then, set the environment.

1. perform the following settings for Windows:

Set PATH = YOUR_INSTALL _ DIR \ bin; C: \ Windows \ Command
Set classpath =.; YOUR_INSTALL_DIR \ lib \ tools. jar

2. Edit the/etc/profile file for Linux:

JAVA_HOME = your_install_dir/JDK/j2sdk
CLASSPATH = $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/td. jar: $ JAVA_HOME/jr
-E/lib/rt. jar :.
PATH = $ PATH: $ JAVA_HOME/bin
Export PATH PS1 USER LOGNAME MAIL HOSTNAME HISTSIZE HISTFILESIZE
INPUTRC JAVA_HOME CLASSPATH RESIN_HOME
Finally, enter Java on the terminal to check whether the command can be found. If the command can be found, the installation is successful.

The following describes several important JDK commands:
Java execution tool is a command to start JVM (Virtual Machine) and execute the class (byte code) file;

Javac compiler, which generates a. class file from the. java file;

Jar Java compression and packaging tools;

Javadoc document builder.

The last step is JDK Documentation. This is JDK's online help document and is the most useful and important learning reference document.

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.