使用ansible远程命令报错:Neither the JAVA_HOME 。。。
来源:互联网 发布:淘宝网兜售野鸟 编辑:程序博客网 时间:2024/05/18 01:03
报错: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启动了。。。
解决办法
想了半天,先测试下Java环境是不是真的有问题吧
[root@ansible ~]# ansible host1 -m shell -a "java -version"
有毒?这个也报错?老办法,ssh上远程主机,同样命令测试
没毛病啊。。。头疼。。。
上网搜,看到有人有类似的问题,说是因为在/bin目录下没有找到Java命令所以报错。
那就用软链接试试
[root@localhost tmp]# cat 123.sh #!/bin/shln -s /usr/local/jdk/bin/jar /bin/jarln -s /usr/local/jdk/bin/java /bin/javaln -s /usr/local/jdk/bin/javac /bin/javacln -s /usr/local/jdk/bin/javah /bin/javahln -s /usr/local/jdk/bin/javadoc /bin/javadoc
然后回到ansible服务端测试
啥都别说了。。我服!
0 0
- 使用ansible远程命令报错:Neither the JAVA_HOME 。。。
- BUG_tomcat启动报错Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- 解决Linux下启动Tomcat遇到Neither the JAVA_HOME ...报错
- 解决Linux下启动Tomcat遇到Neither the JAVA_HOME ...报错
- Linux下Tomcat启动报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one
- 向linux中上传文件后,重启tomcat报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At le
- 向linux中上传文件后,重启tomcat报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At le
- tomcat7.0以上版本运行startup的时候报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 错误&&Eclipse 访问tomcat首页报404错误
- 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
- 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 or the JRE_HOME environmental 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
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Flask 让jsonify返回的json串支持中文显示
- hdu2095 异或法
- 实现oracle表字段序列化
- CentOS 7从Python 2.7升级至Python3.6.1
- BZOJ2323: [ZJOI2011]细胞
- 使用ansible远程命令报错:Neither the JAVA_HOME 。。。
- Java-json系列(一):用GSON解析Json格式数据
- HDUoj 1412 {A} + {B} ( set &去重函数
- JavaWeb之JSP自定义标签
- 二叉树的最小深度
- Java中static关键字用法总结
- 关于typedef的用法总结
- Date 时间操作工具类
- 文件输入cin>>的返回值