Install Java environment in CentOS, add soft link times: ln: failed to create symbolic link ‘/ usr/bin/Java’: file exists
[root@iZbp12f9404um3f6avsm29Z /]# ln -s /usr/local/java/jdk1.8.0_291/bin/java /usr/bin/java
ln: failed to create symbolic link ‘/usr/bin/java’: File exists
Failed to create symbolic link, file exists.
-s The meaning of the command is to add symbolic links to play the role of a link
resolvent
[root@iZbp12f9404um3f6avsm29Z /]# ln -sf /usr/local/java/jdk1.8.0_291/bin/java /usr/bin/java
[root@iZbp12f9404um3f6avsm29Z /]# java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
Modify the – s command to – SF command- The f command means to enforce, which means to create if it does not exist and to override if it does exist
So far, the creation of soft connection is completed
Read More:
- [Solved] Docker Run Tomcat Error: Cannot find /usr/local/tomcat/bin/setclasspath.sh
- [Solved] JPA Create Sheet error at the First time: Cant DROP [xxx];check that column/key exists
- How to Solve Java Runtime (class file version 53.0)ERROR
- [Solved] rocketmq Startup Error: Error: Could not create the Java Virtual Machine.
- [Solved] Jedis connect and operate Redis error: Failed to create socket和connect timed out
- [Solved] Hadoop Error: Exception in thread “main“ java.io.IOException: Error opening job jar: /usr/local/hadoop-2.
- [Solved] SpringBoot Create Project and Failed to Access localhost:8080 Error
- [Solved] IDEA java compile error: Error:java: Compilation failed: internal java compiler error
- [Solved] Java: compilation failed: internal java compiler error
- How to Solve ERROR: Java 1.7 or later is required to run Apache Drill
- Eclipse Error: Could not create the Java Virtual Machine Error:A fatal exception has occurred
- Java error: unable to find or load main class (package name in source file)
- [Solved] JAVA Python Error: Cannot create PyString with non-byte value
- Java Error | Error:java: Compilation failed: internal java compiler error
- [Solved] Read the resources resource and convert it to file error: java.io.filenotfoundexception
- [Solved] Failed to convert value of type ‘java.lang.String‘ to required type ‘java.util.Date‘;
- How to Solve Flynk Task Java verifyerror 209 error
- [Solved] Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred.
- [Solved] Kafka in Windows error:java. nio. file. Filesystemexception: this file is in use by another program and cannot be accessed by the process
- IDEA Compile Error: java Compilation failed internal java compiler error