In linux, jdk configuration-general Linux technology-Linux programming and kernel information. The following is a detailed description. Today, I installed linux on paper before talking about it. Today, the actual usage is actually confused, so I wrote down my experiences to help my friends who encountered the same problem learn from them:
Jdk installation: I will not talk about it here
Environment variable settings, many people on the Internet are instructions
Enter commands in the terminal
Vi/etc/profile. d/java. sh (this is the center vi command esc switch, which has the commond and insert interfaces. I use redhat, where I enter the insert interface, esc returns the commond interface, w is the save ,: wq is to save and quit, q! Is forced to exit, more can be checked online)
This can be used by all users. Enter the following fields in the file:
# Set java environment
Export JAVA_HOME =/usr/java/jdk1.5.0 _ 15 (this path depends on where you installed it by default under/usr/java)
Export CLASSPATH =./: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib
Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH
Save and exit
Source/etc/profile. d/java. sh is equivalent to./etc/profile/java. sh
If you encounter a running permission problem, you can use chmod 755/ect/profile. d/java. sh to open the running permission 777 to open all the Read and Write execution permissions.
The set command can view the set path! Author: hawk
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.