Article Title: describes how to configure JDK in a Linux operating system. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
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. /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!