Linux configuration jdk development platform-general Linux technology-Linux technology and application information, the following is a detailed description. 1. Install jdk
1. Download and install jdk
(1) first, find the jdk to download in the http://java.sun.com, download your own jdk version. I am using JDK 6 here and get a file named jdk-6u6-linux-i586-rpm.bin. This file is currently not running shell script.
(2) Change permissions and extract the jdk installation file:
Open the terminal and run: # chmod a + x
Jdk-6u6-linux-i586-rpm.bin
#./Jdk-6u6-linux-i586-rpm.bin
After entering yes as prompted, jdk is decompressed to The./j2sdk1.4.2 _ 04 directory.
(3) create a java installation path:
# Mkdir/usr/java
(4) installation files
# Rpm-ivh jdk-6u6-linux-i586-rpm
The installation software automatically installs JDK under the/usr/java/directory.
2. Configure Environment Variables
(1) open a file :#
Vi
/Etc/profile
Add the following to the file:
Export
JAVA_HOME =/usr/java/jdk1.6.0 _ 06
Export
PATH = $ JAVA_HOME/bin: $ PATH
Export
CLASSPATH =.: JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
(2) log out again, and then open the terminal and enter: # echo $ JAVA_HOME
# Javac
# Java
# Java? Version
The version information is correct.
Now we can write a helloworld command to test whether jdk is installed!
# Vi HelloWord. java
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