Skip to content

Commit ed7939b

Browse files
committed
Try JDK again
1 parent 60c351a commit ed7939b

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

dev/conda/osx-64/build.sh

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,41 @@ DEV_CONDA=$( cd $RECIPE_DIR/.. ; /bin/pwd -P )
1414
echo CONDA_EXE=$CONDA_EXE
1515
CONDA=$( dirname $( dirname $CONDA_EXE ) )
1616
# OpenJDK home should be under MINICONDA/pkgs/openjdk-*
17-
# Should be in MINICONDA/bin
17+
# Should be in MINICONDA/bin but is not on any system
18+
# On Linux it is under $CONDA/pkgs/openjdk-*/lib/jvm/bin
19+
# On GitHub macos-13 it is under $CONDA/lib/jvm/bin
1820
echo FIND JAVA
1921
which java javac || true
2022
conda list
2123
source $CONDA/etc/profile.d/conda.sh
2224
which java javac || true
2325
echo $PATH
2426
set -x
27+
FOUND_JDK=0
2528
find $CONDA -name java
26-
OPENJDK=( $( find $CONDA/pkgs -type d -name "openjdk-*" ) )
27-
if (( ${#OPENJDK} == 0 ))
29+
JDKS=( $( find $CONDA/pkgs -type d -name "openjdk-*" ) )
30+
if (( ${#JDKS} > 0 ))
2831
then
29-
echo "build.sh: Could not find OpenJDK in $CONDA"
30-
exit 1
32+
JDK_BIN=${JDKS[0]}/lib/jvm/bin
33+
if ! [[ -d $JDK_BIN ]]
34+
then
35+
echo "build.sh: Broken JVM directory structure in $CONDA"
36+
exit 1
37+
fi
38+
FOUND_JDK=1
3139
fi
32-
if ! [[ -d ${OPENJDK[0]}/lib/jvm/bin ]]
40+
if [[ -d $CONDA/lib/jvm/bin ]]
3341
then
34-
echo "build.sh: Could not find OpenJDK binaries in $CONDA"
42+
JDK_BIN=$CONDA/lib/jvm/bin
43+
FOUND_JDK=1
44+
fi
45+
if (( ! FOUND_JDK ))
46+
then
47+
echo "build.sh: Could not find OpenJDK in $CONDA"
3548
exit 1
3649
fi
37-
echo "build.sh: Found OpenJDK: $OPENJDK"
38-
PATH=${OPENJDK[0]}/lib/jvm/bin:$PATH
50+
echo "build.sh: Found OpenJDK bin directory: $JDK_BIN"
51+
PATH=$JDK_BIN:$PATH
3952
which java javac
4053

4154
if (( ${ENABLE_R:-0} ))

0 commit comments

Comments
 (0)