From 8b849466ee9a4864a6134a01f186f43132108158 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Sun, 4 Jun 2023 22:31:29 -0400 Subject: [PATCH] Update utils.py --- pygeoweaver/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygeoweaver/utils.py b/pygeoweaver/utils.py index 975ddf6..4b864d6 100644 --- a/pygeoweaver/utils.py +++ b/pygeoweaver/utils.py @@ -39,13 +39,13 @@ def get_root_dir(): def get_java_bin_from_which(): # Check if 'which' command is available try: - subprocess.check_output(['which', 'java']) + subprocess.check_output(['source', '~/.bashrc', '&&', 'which', 'java']) except (subprocess.CalledProcessError, FileNotFoundError): return None # Run 'which java' command to get the Java binary path try: - output = subprocess.check_output(['which', 'java'], encoding='utf-8') + output = subprocess.check_output(['source', '~/.bashrc', '&&', 'which', 'java'], encoding='utf-8') java_bin_path = output.strip() except subprocess.CalledProcessError: return None