链接远程 linux 时提示找不到 java
[07/14/18 23:49:44] [SSH] Checking java version of java Couldn't figure out the Java version of java bash: java: command not found [07/14/18 23:49:44] [SSH] Checking java version of /usr/bin/java Couldn't figure out the Java version of /usr/bin/java bash: /usr/bin/java: No such file or directory [07/14/18 23:49:44] [SSH] Checking java version of /usr/java/default/bin/java Couldn't figure out the Java version of /usr/java/default/bin/java bash: /usr/java/default/bin/java: No such file or directory [07/14/18 23:49:45] [SSH] Checking java version of /usr/java/latest/bin/java Couldn't figure out the Java version of /usr/java/latest/bin/java bash: /usr/java/latest/bin/java: No such file or directory [07/14/18 23:49:45] [SSH] Checking java version of /usr/local/bin/java Couldn't figure out the Java version of /usr/local/bin/java bash: /usr/local/bin/java: No such file or directory [07/14/18 23:49:45] [SSH] Checking java version of /usr/local/java/bin/java Couldn't figure out the Java version of /usr/local/java/bin/java bash: /usr/local/java/bin/java: No such file or directory [07/14/18 23:49:45] [SSH] Checking java version of /root/.jenkins/jdk/bin/java Couldn't figure out the Java version of /root/.jenkins/jdk/bin/java bash: /root/.jenkins/jdk/bin/java: No such file or directory Linux wxiaohui-ubuntu 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Installing JDK jdk-8u144-oth-JPR Downloading JDK from http://download.oracle.com/otn/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gzOracle now requires Oracle account to download previous versions of JDK. Please specify your Oracle account username/password.java.io.IOException: Could not find any known supported java version (a minimum level of 8 is required) in [java, /usr/bin/java, /usr/java/default/bin/java, /usr/java/latest/bin/java, /usr/local/bin/java, /usr/local/java/bin/java, /root/.jenkins/jdk/bin/java], and we also failed to install JDK as a fallback at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:954) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:836) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:820) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: hudson.AbortException: Unable to install JDK unless a valid Oracle account username/password is provided in the system configuration. at hudson.tools.JDKInstaller.locate(JDKInstaller.java:539) at hudson.plugins.sshslaves.SSHLauncher.attemptToInstallJDK(SSHLauncher.java:1075) at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:951) ... 6 more [07/14/18 23:49:48] Launch failed - cleaning up connection [07/14/18 23:49:48] [SSH] 连接关闭。
提示找不到 java 命令的错误, 但是我 linux 上的确安装了 JDK 而且也配置了环境变量,任意目录下都可以使用 java 命令,
root@wxiaohui-ubuntu:~# java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
root@wxiaohui-ubuntu:~#
不知道这里为什么会提示找不到 java
求解答