使用ansible远程命令报错:Neither the JAVA_HOME 。。。
2017-04-11 17:16
429 查看
报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
我只是想通过ansible开启远程服务器的Tomcat,然后报找不到JRE,然后我进入远程主机开启Tomcat的时候,糟心的事情发生了。。
Tomcat启动了。。。
有毒?这个也报错?老办法,ssh上远程主机,同样命令测试
没毛病啊。。。头疼。。。
上网搜,看到有人有类似的问题,说是因为在/bin目录下没有找到Java命令所以报错。
那就用软链接试试
然后回到ansible服务端测试
啥都别说了。。我服!
At least one of these environment variable is needed to run this program
我只是想通过ansible开启远程服务器的Tomcat,然后报找不到JRE,然后我进入远程主机开启Tomcat的时候,糟心的事情发生了。。
Tomcat启动了。。。
解决办法
想了半天,先测试下Java环境是不是真的有问题吧[root@ansible ~]# ansible host1 -m shell -a "java -version"
有毒?这个也报错?老办法,ssh上远程主机,同样命令测试
没毛病啊。。。头疼。。。
上网搜,看到有人有类似的问题,说是因为在/bin目录下没有找到Java命令所以报错。
那就用软链接试试
[root@localhost tmp]# cat 123.sh #!/bin/sh ln -s /usr/local/jdk/bin/jar /bin/jar ln -s /usr/local/jdk/bin/java /bin/java ln -s /usr/local/jdk/bin/javac /bin/javac ln -s /usr/local/jdk/bin/javah /bin/javah ln -s /usr/local/jdk/bin/javadoc /bin/javadoc
然后回到ansible服务端测试
啥都别说了。。我服!
相关文章推荐
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 错误解决
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- java中使用JSCH包,SFTP及SSH2文件操作及远程命令执行
- tomcat7.0以上版本运行startup的时候报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME or the JRE_HOME environmental variable is defined 解决方案
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined (转)
- java 使用jsch 远程链接linux执行命令
- java中使用JSCH包,SFTP及SSH2文件操作及远程命令执行
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 2013-03-07 21:35 3946人阅读 评论(0) 收藏
- linux安装tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- jkd7、tomcat7安装详解。Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 错误解决
- java中使用JSCH包,SFTP及SSH2文件操作及远程命令执行(改进)
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- tomcat error: Neither the JAVA_HOME nor the JRE_HOME environment variable is defin
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 错误解决
- Neither the JAVA_HOME or the JRE_HOME environmental variable is defined
- windows 与linux出现 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined