Install JDK in Linux

Source: Internet
Author: User
Tags echo command

Linux install JDK detailed steps Linux install JDK Step 1. First download jdk (jdk-1_5_0_02-linux-i586.rpm) from the Internet, recommended
SUN's official website www.sun.com is downloaded and stored in the/home directory. Of course, it works elsewhere. Go to the installation directory www.2cto.com # cd/home # cp jdk-1_5_0_02-linux-i586.rpm/usr/local # cd/usr/local to add executable permissions to all users # chmod + x jdk-1_5_0_02-linux-i586.rpm.bin #. /jdk-1_5_0_02-linux-i586.rpm.bin at this time will generate a file jdk-1_5_0_02-linux-i586.rpm, also to all users to add executable permissions # chmod + x jdk-1_5_0_02-linux-i586.rpm installer # rpm-ivh jdk-1_5_0_02-linux-i586.rpm appears the installation protocol, etc., as per accept. Install JDK in Linux Step 2. Set environment variables. # Vi/etc/profile added at the end # set java environmentJAVA_HOME =/usr/java/jdk-1_5_0_02CLASSPATH =.: $ JAVA_HOME/lib. tools. jarPATH = $ JAVA_HOME/bin: $ PATHexport JAVA_HOME CLASSPATH save and exit. To enable JDK to be used by all users, you can: vi/etc/profile. d/java. sh in the new java. enter the following content in sh: # set java environmentJAVA_HOME =/usr/java/jdk-1_5_0_02CLASSPATH =.: $ JAVA_HOME/lib/tools. jarPATH = $ JAVA_HOME/bin: $ PATHexport JAVA_HOME CLASSPATH save and exit. sh: chmod 755/etc/profile. d/java. step 3 of installing JDK in shLinux. run the echo command on the terminal to check the environment variable settings. # Echo $ JAVA_HOME # echo $ CLASSPATH # echo $ PATH4. check whether JDK is installed successfully. # If the JVM version and related information are displayed, the installation is successful! Then the installation of JDK in Linux is over and the development door is opened. GOGOGO!

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.