int128 / gradle-ssh-plugin

Gradle SSH Plugin
https://gradle-ssh-plugin.github.io
Apache License 2.0
319 stars 60 forks source link

restart tomcat failed #252

Closed tianzx closed 8 years ago

tianzx commented 8 years ago

dev#1|Neither the JAVA_HOME nor the JRE_HOME environment variable is defined dev#1|At least one of these environment variable is needed to run this program Failed command dev#1 with status 1: /data/server/tomcat-ui/bin/startup.sh :start FAILED

but I can restart it by teminal

LeonardoMolina commented 8 years ago

I had a similar issue, be sure that the user that you are running the script it's the same that you are using to restart tomcat, also, I'd recommend installing tomcat as a service instead.

tianzx commented 8 years ago

I had solved the issue . when I excute the script like this: execute "export JAVA_HOME=/opt/jdk1.7.0_79 ; /data/server/tomcat-ui/bin/startup.sh " ; it will success;but if you excute like this:execute "export JAVA_HOME=/opt/jdk1.7.0_79 "; execute "/data/server/tomcat-ui/bin/startup.sh " ,it will fail. I had finished the demo https://github.com/tianzx/uploadScript Thank your great tool ,it help me save lots of time

int128 commented 8 years ago

The first one works because execute has each independent environment variables. And in some environment, there is difference between terminal and SSH due to .profile.