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

Source: Internet
Author: User

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 ~

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.