After Centos compilation and installation of jdk, JPS cannot be used
1. My java home Directory:/usr/local/java
2. First, my environment variable configuration is correct, because I use java-version to view the actual java environment
3. But I encountered a problem when using the jps command:
4. The online saying is that the environment variables are not configured. For example, the variables to be called are placed behind the variable calling formula;
5. If the environment variable configuration is correct, perform the following operations to fix the problem:
Step 1: Determine the compiled java Directory, which must be/usr/local/java
Run the first command:
Update-alternatives -- install/usr/bin/java/usr/local/java/bin/java300
Run the second command:
Update-alternatives -- install/usr/bin/javac/usr/local/java/bin/javac300
Run the third command:
Update-alternatives -- config java
You can see. There are two java execution programs in the system. This should be because the jdk installed in the original rpm has not been uninstalled. Select Number 2, and the compiled java directory
Run the fourth command:
Update-alternatives -- config javac
Same operation
6. Run the JPS command to check whether the JPS can be used?
PS: if the file/usr/bin is not available
Ln-s/usr/local/java/bin/jps/usr/bin
Run this command.
PPS ~