LINUX PATH and CLASSPATH settings

xiaoxiao2021-03-06  63

First, install JDK directly from the Sun website directly download JDK: http://java.sun.com/j2se/1.4.2/download.html provides two downloads: 1, rpm in self-extracting file (J2SDK-1_4_2_04 -Linux-i586.bin, 32.77 MB) This is self-extracting file, installed on Linux: # chmod u x ./j2sdk-1_4_2_04-linux-i586.bin# ./j2sdk-1_4_2_04-linux-i586. After pressing YES by prompt, the JDK is decompressed to ./j2sdk1.4.2_04 directory. For the JDK installation path in the following 2, we will do the following, establish the installation path under / usr / java, and take the file under the path: # mkdir / usr / java # cp -fr ./j2sdk1.4.2_04 / usr / java2, rpm in self-extracting file (J2SDK-1_4_2_04-linux-i586-rpm.bin, 32.77 MB) This is also a self-extracting file, but the decompressed file is J2SDK-1_4_2_04-Linux-i586-RPM package , Execute the RPM command to load it on Linux. Installation as follows: #CHMOD u x ./j2sdk-1_4_2_04-linux-i586-rpm.bin# ./j2sdk-1_4_2_04-linux-i586-rpm.bin# rpm -ivh j2sdk-1_4_2_04-linux-i586-rpm installation software JDK is automatically installed to /usr/java/j2sdk1.4.2_04 directory. Second, Configuring Environment Variables 1. Modify User Environment Variables Assume that use Java's users for KUNP, edit the user's .bashrc file for environment variable settings. # vi /Home/kunp/.bashrc Add: export java_home = / usr / java / j2sdk1.4.2_04export classpath = $ ClassPath: $ java_home / lib: $ java_home / jre / libexport path = $ java_home / bin : $ JAVA_HOME / JRE / BIN: $ PATH: $ homr / bin2. Modify all users' environment variables # vi / etc / profile Add: export java_home = / usr / java / j2sdk1.4.2_04export classpath = $ ClassPath : $ JAVA_HOME / LIB: $ JAVA_HOME / JRE / LIBEXPORT PATH = $ java_home / bin: $ java_home / jre / bin: $ PATH: $ home / bin If it is logged in as root, only the second step is possible. Because it already contains the first step setting, huh, huh. One thing to pay attention to, if you want to test whether it is successful after the change, you can restart a machine. I am because I have not restarted, so I have not succeeded, so I am depressed. . }嘿})

转载请注明原文地址:https://www.9cbs.com/read-84646.html

New Post(0)