Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show-busy-java-threads.sh增加对JAVA_HOME环境变量的判断 #15

Merged
merged 1 commit into from
Mar 27, 2013
Merged

show-busy-java-threads.sh增加对JAVA_HOME环境变量的判断 #15

merged 1 commit into from
Mar 27, 2013

Conversation

silentforce
Copy link
Contributor

set JAVA_HOME & PATH 

set JAVA_HOME & PATH 
@silentforce
Copy link
Contributor Author

脚本里面直接使用了jstack,增加对JAVA_HOME环境变量的判断.不然会产生找不到jstack命令的错误.

oldratlee added a commit that referenced this pull request Mar 27, 2013
Update show-busy-java-threads.sh
@oldratlee oldratlee merged commit 295ff33 into oldratlee:master Mar 27, 2013
@oldratlee
Copy link
Owner

不错。可以处理 环境设置了JAVA_HOME但是PATH没有jstack命令的情况。
合并了!

判断代码

if [ "$JAVA_HOME" = "" ]; then
  echo "Error: JAVA_HOME is not set."
  exit 1
fi

没有JAVA_HOME则退出执行。

改成,如果在PATH上找不到jstack,再从JAVA_HOME上找jstack,如何? @silentforce
这样 PATHjstack,没有设置JAVA_HOME,可以成功执行。

@silentforce silentforce deleted the patch-1 branch July 11, 2013 03:27
@ghost ghost assigned oldratlee Jul 29, 2013
@oldratlee oldratlee assigned oldratlee and unassigned oldratlee Apr 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants