After Centos compilation and installation of jdk, JPS cannot be used

Source: Internet
Author: User
1. my java home directory:/usr/local/java2. first, my environment variable configuration is correct, because I use java-version to view my actual java environment 3, but I encountered problems 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

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/java 300

Run the second command:

Update-alternatives -- install/usr/bin/javac/usr/local/java/bin/javac 300

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 ~

Related Article

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.