View JDK installation directory, Linux uninstall JDK, rpm command, RM command parameters in Linux

Source: Internet
Author: User
Tags solr

First, view the JDK installation directory
whereis javajava:/usr/bin/java/usr/local/java
which Java/usr/bin/java
Echo $JAVA _home Echo $PATH/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:java_home/bin:/usr/local/java/ Jdk1.7.0_80/bin:/usr/local/erlang/bin:/root/bin

Note: If you are in Windows, you can use:

set Java_home: View JDK Installation path
java-version: View JDK version

Second, uninstall the JDK (sub-condition unloading) 1. Uninstall the JDK version that comes with your system:

To view your own JDK:

Rpm-qa|grep GCJ

You may see a message similar to the following:

Libgcj-4.1.2-44.el5

java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

Use the RPM-E--nodeps command to delete what you found above:

rpm-e–nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

2. uninstalling the JKD version of RPM installation

To view the installed JDK:

Rpm-qa|grep JDK

You may see a message similar to the following:

Jdk-1.6.0_22-fcs

Unloading:

rpm-e--nodeps Jdk-1.6.0_22-fcs

remark: if you have rpm in your Linux box, you should first determine if Java is installed using RPM. If Java is not installed using RPM, skip this section.

      1. Open Terminal window
      2. Log in as superuser root
      3. Type the following command to try to find the JRE package:rpm -qa
      4. If RPM reports a package similar to Jre--fcs , it means that Java is installed using RPM.

        Note: in general, you do not have to use RPM to unload Java because RPM can automatically uninstall older versions of java! when installing new versions Skip this section unless you are ready to permanently delete Java.
      5. To uninstall Java, type:rpm -e jre --fcs
3, self-extracting file unloading (very violent practice, delete the installation folder directly)

(1) Determine if Java is installed in some folders. Common locations include /usr/java/jre_ or/opt/jre_nb/jre_/bin/java/

(2) If you find a folder to install Java, you can delete this folder.

cd/usr/local/ lsbin  etc  Games  include  java  lib  lib64  libexec  nginx  Sbin  share  solr  solrcloud  lsbin  etc  Games  include  Lib  lib64  libexec  nginx  sbin  share  solr  solrcloud  java-verisonbash:/ Usr/local/java/jdk1.8.0_111/bin/java: No file or directory

Warning:   before deleting a folder, make sure that Java was not previously installed with RPM.

(3) Type: rm -r jre
For example:rm -r jre1.7.0

RPM Command set:

Query all installed RPM packages rpm   -qa query Specifies whether the installation package is installed rpm  -qa  |  grep  package_name View details of an installed package rpm  -qi  package_anme View the configuration file for an installation package RPM-QC  Package_name Viewing a list of files generated by an installation package rpm  -ql  package_name Install an installation package    rpmrpm  -IVH  Package_name-    v shows detailed process-   h to # Show progress;

RM Command Parameters:

-D: Delete the hard connection data of the directory you want to delete to 0, delete the directory;
-F: Forcibly deleting files or directories;
-I: Ask the user before deleting an existing file or directory;
-R or-R: Recursive processing, all files under the specified directory are processed in conjunction with subdirectories;
--preserve-root: Do not recursively operate the root directory;
-V: Displays the detailed execution of the instruction.

View JDK installation directory, Linux uninstall JDK, rpm command, RM command parameters in Linux

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.