What should I do if the linux jdk does not take effect?
Linux After modifying jdk, it does not take effect. I encountered it once before but didn't record it. I will record it this time.
1. Install jdk1.8.
2. Modify JAVA_HOME in /etc/profile to the new jdk path, and execute source /etc/profile.
3. Execute java -version. At this time, the jdk version is still shown as 1.7.
4. Execution:
which java which javac
Delete the java and javac files in the execution results of the above two instructions.
5. Execute:
ln -s $JAVA_HOME/bin/java /usr/bin/java ln -s $JAVA_HOME/bin/javac /usr/bin/javac
6. Execute:
source /etc/profile
7. Execute java -version, you can see that jdk is switched to version 1.8.
Note:
1. If the execution error is that the java file does not have permissions, first set the permissions for the java file: chmod u x java.
Recommended: "linux tutorial"
The above is the detailed content of What to do if linux jdk does not take effect. For more information, please follow other related articles on the PHP Chinese website!