Skip to content

Commit e476e28

Browse files
authored
Merge pull request #4 from CellProfiler/CP
Locate Java with CP_JAVA_HOME
2 parents b977d42 + 677888b commit e476e28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

javabridge/locate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ def is_mingw():
7070

7171
def find_javahome():
7272
"""Find JAVA_HOME if it doesn't exist"""
73-
if 'JAVA_HOME' in os.environ:
73+
if 'CP_JAVA_HOME' in os.environ:
74+
# Prefer CellProfiler's JAVA_HOME if it's set.
75+
return os.environ['CP_JAVA_HOME']
76+
elif 'JAVA_HOME' in os.environ:
7477
return os.environ['JAVA_HOME']
7578
elif is_mac:
7679
# Use the "java_home" executable to find the location

0 commit comments

Comments
 (0)