Repository navigation
oracle-visualvm-issues-623 Added JAVA_HOME to visulavm luncher & conf - #643
dasarathirout wants to merge 9 commits into
Conversation
Signed-off-by: Dasarathi Rout <[email protected]>
|
|
||
| if [ -f "$progdir"/../lib/visualvm/etc/visualvm.conf ] ; then | ||
| visualvm_jdkhome="$basedir" | ||
| if [[ -d "$JAVA_HOME" && -f "$JAVA_HOME/bin/java" ]]; then |
There was a problem hiding this comment.
The Windows version also takes JDK_HOME into consideration, maybe it would be better to have the same behaviour.
Signed-off-by: Dasarathi Rout <[email protected]>
Signed-off-by: Dasarathi Rout <[email protected]>
Signed-off-by: Dasarathi Rout <[email protected]>
Signed-off-by: Dasarathi Rout <[email protected]>
| fi | ||
|
|
||
| if [ -f "$progdir"/../lib/visualvm/etc/visualvm.conf ] ; then | ||
| visualvm_jdkhome="$basedir" |
There was a problem hiding this comment.
Won't this overwrite the visualvm_jdkhome if the config file is present, even if visualvm_jdkhome is not defined in it ?
We only want to override JAVA_HOME if visualvm.conf is found AND visualvm_jdkhome is defined in it.
There was a problem hiding this comment.
I appreciate any insights or corrections you might have.
Won't this overwrite the visualvm_jdkhome if the config file is present, even if visualvm_jdkhome is not defined in it ?
Setting default value for luncher visualvm_jdkhome based on JDK_HOME or JAVA_HOME env.
after we check for visualvm_jdkhome in visualvm.conf (it might not be defined here ) and overide with privious JDK_HOME or JAVA_HOME env any.
We only want to override JAVA_HOME if visualvm.conf is found AND visualvm_jdkhome is defined in it.
My understanding bellow order
- we default to env var
- then visualvm.conf configuration (if defined , else env )
- --jdkhome argument override env & conf
There was a problem hiding this comment.
Your second example covers the case when the config file is in etc/
But line 66/73 overwrites the variable you set in the patch if the config file is found in lib/
if [ -f "$progdir"/../lib/visualvm/etc/visualvm.conf ] ; then visualvm_jdkhome="$basedir"
Signed-off-by: Dasarathi Rout <[email protected]>
stoty
left a comment
There was a problem hiding this comment.
+1 LGTM.
Note that I haven't tested this, only eyeballed.
| fi | ||
| } | ||
|
|
||
| set_jdk_java_home_from_conf(){ |
There was a problem hiding this comment.
nit: set_jdk_java_home would be a better name, as this falls back to environment variables.
Signed-off-by: Dasarathi Rout <[email protected]>



oracle-visualvm-issues-#623 Added JAVA_HOME to visulavm luncher & conf