Command Failed: Java not usable, bash: java: command not found

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: command Fail java not usable, bash: java: command not found

| username: TiDBer_N3caE3vj

[TiDB Usage Environment] Production environment, JDK environment has been confirmed with java -version, jdk 1.8
[TiDB Version] v7.1.0
[Reproduction Path] After executing the check command, tiup cluster check ./topology.yaml --user root -p
[Encountered Problem: Problem Phenomenon and Impact]

| username: zhanggame1 | Original post link

Check the node where the problem was detected, and use the root user to check the java command on that machine.
I found that only deploying TiSpark checks for java.

| username: redgame | Original post link

Read the environment variables in the corresponding environment.

| username: 我是咖啡哥 | Original post link

If TiSpark is not deployed, it can be ignored. If you want to deploy it, you need to set the environment variables with the user you deployed, not necessarily root.

| username: TiDBer_N3caE3vj | Original post link

I found the problem. There will be issues if the JDK used to install the TiSpark server is from Oracle. I changed it to OpenJDK and the problem was resolved.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.