Linux reload jdk with rpm

Source: Internet
Author: User

1. Uninstalling the JDK#rpm-qa | grep GCJ If the output has no content, it means that there is no JDK, if the output has content, to unload the search to the file, the command is: #rpm-e--nodeps [file output from the previous step] and then use #whereis Java directly delete Java related files or folders 2. Download the JDK you needto Oracle website http://www.oracle.com/technetwork/java/javase/downloads/ jdk8-downloads-2133151.html Find the download link and then use wget download, because Oracle needs to accept Lincence, wget need to add some parameters (--no-check-certificate-- No-cookies--header "Cookie:oraclelicense=accept-securebackup-cookie") like to download the latest jdk8,rpm version of #wget-- No-check-certificate--no-cookies--header "Cookie:oraclelicense=accept-securebackup-cookie" http// download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm 3. Install with RPMCommand #mkdir/usr/local/java#cd/usr/local/java to move the download file to/usr/local/java, and then install the #rpm-ivh JDK-8U92-LINUX-X64.RPM installation of the time will appear waiting for output, no error indicates that the installation was successful 4. Declaring Environment VariablesConfigure the amount of environment #vi/etc/profile (add sudo before the permission) at the bottom of the profile adds the following content #export Java_home=/usr/java/jdk1.8.0_92#export path= $JAVA _ Home/bin#export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar If it is already present, modify it to a new installed path and then add it. After saving exits Execute the following command to make the configuration effective #source/etc/profile 5. View JDK version#java-version

Linux reload jdk with rpm

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.