Completely uninstall jdk

When you can not uninstall jdk command, I can try this method to remove the old version of the jdk violence

JAVA_HOME delete all files

Then use the following command:

the Java whereis
Which the Java (the Java execution path)
echo $ JAVA_HOME

echo $ PATH (Note retain the PATH, the following will be used)

1. Find all older versions of java, then use the rm -r full path 

2.vim /etc/profile

  The $ PATH in on an older version of java deleted, that is reassigned as follows:

  

export PATH = / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / usr / games: / usr / local / games: / snap / bin: /home/ldy/apps/hadoop-2.8.5//bin:/home/ldy/apps/hadoop-2.8.5//sbin 
# remove old java path, using re-assignments of the pATH delete old java information 
Export the JAVA_HOME = / Home / LDY / Apps / JDK-11.0.4 # setting environment variables
Export the PATH the PATH = $: $ the JAVA_HOME / bin Export the JRE_HOME the JAVA_HOME = $ {} Export the CLASSPATH =:. $ {the JAVA_HOME} / lib: $ {} the JRE_HOME / lib: $ the CLASSPATH Export the JAVA_PATH the JAVA_HOME = $ {} / bin: $ {} the JRE_HOME / BI

  

source /etc/profile

Install the new version of jdk

java -version to see the new version of the java

 

Guess you like

Origin www.cnblogs.com/ldy233/p/11470510.html