Skip to content

Commit c9482e9

Browse files
committed
initialize java_home
1 parent a4f3960 commit c9482e9

File tree

1 file changed

+3
-2
lines changed
  • tools/src/main/python/opengrok_tools/utils

1 file changed

+3
-2
lines changed

tools/src/main/python/opengrok_tools/utils/java.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# CDDL HEADER END
1919

2020
#
21-
# Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
21+
# Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
2222
# Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
2323
#
2424

@@ -82,12 +82,13 @@ def FindJava(self, logger):
8282
system_name = platform.system()
8383
if system_name == 'SunOS':
8484
rel = platform.release()
85+
java_home = None
8586
if rel == '5.10':
8687
java_home = "/usr/jdk/instances/jdk1.7.0"
8788
elif rel == '5.11':
8889
java_home = "/usr/jdk/latest"
8990

90-
if os.path.isdir(java_home):
91+
if java_home and os.path.isdir(java_home):
9192
java = os.path.join(java_home, 'bin', 'java')
9293
elif system_name == 'Darwin':
9394
cmd = Command(['/usr/libexec/java_home'])

0 commit comments

Comments
 (0)