Installation of JDK under Linux and settings of Java environment variables

xiaoxiao2021-03-06  26

Many people who have developed Java under Linux will encounter the setting of JDK environment variables. For beginners, this article is necessary. Many people who have developed Java under Linux will encounter the setting of JDK environment variables. For beginners, this article is necessary. In Linux, the JDK installation and the Java environment variable setting 1, to www.sun.com to download the latest version of J2SDK for Linux 2, install JDK1.4.2 for Linux, the following is in redhat Linux 9: Log in as root (1) Open a terminal (2) Enter a command ls -l to view the permissions of the installation file (3) Enter the command CHMOD A X J2SDK-1_4_2_01-Linux-i586-rpm.bin to add permissions to all users. (4) Install JDK ./j2sdk-1_4_2_01-linux-i586-rpm.bin rpm -ivh j2sdk-1_4_2_01-Linux-i586-rpm appears, press ENTER to accept (5) Using the default installation location, in / usr / Java / Under, ie /usr/java/j2sdk1.4.2_01 3, set the environment variable to use the VI editor for environmental variables: Enter the command vi /etc/profile.d/java.sh in the terminal in the new Java .SH Enter the following: #set Java Environment Export Java_Home = / USR / Java / J2SDK1.4.2_01 Export ClassPath =.: $ java_home / lib: $ java_home / jre / lib export path = $ java_home / bin: $ java_home / JRE / BIN: $ PATH Save Exit 4, assign permissions to java.sh allocation: chmod 755 /etc/profile.d/java.sh 5, restart your computer Enter the following command in the terminal, test whether JDK is installed successfully Java - Version If you see information with JVM, you have successful installation.

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

New Post(0)