LINUX_JDK_URL="https://download.java.net/java/GA/jdk11/9/GPL/$LINUX_JDK_TAR"
LINUX_JFX_URL="https://download2.gluonhq.com/openjfx/$JAVA_VERSION/$LINUX_JFX_ZIP"
+MAC_JDK_TAR="openjdk-${JAVA_VERSION}_osx-x64_bin.tar.gz"
+MAC_JFX_ZIP="openjfx-${JAVA_VERSION}_osx-x64_bin-sdk.zip"
+MAC_JDK_URL="https://download.java.net/java/GA/jdk11/9/GPL/$MAC_JDK_TAR"
+MAC_JFX_URL="https://download2.gluonhq.com/openjfx/$JAVA_VERSION/$MAC_JFX_ZIP"
+
JSON_BUILD="20160810"
JSON_JAR="json-$JSON_BUILD.jar"
JSON_URL="https://search.maven.org/remotecontent?filepath=org/json/json/$JSON_BUILD/$JSON_JAR"
if [ ! -d "$JDK_DIR" ]; then
if [ ! -f "$WIN_JDK_ZIP" ]; then
- wget "$WIN_JDK_URL";
+ curl -o "$WIN_JDK_ZIP" "$WIN_JDK_URL";
fi;
$UNZIP "$WIN_JDK_ZIP"
fi;
if [ ! -d "$JFX_DIR" ]; then
if [ ! -f "$WIN_JFX_ZIP" ]; then
- wget "$WIN_JFX_URL";
+ curl -o "$WIN_JFX_ZIP" "$WIN_JFX_URL";
fi;
$UNZIP "$WIN_JFX_ZIP"
fi;
if [ ! -d "$JDK_DIR" ]; then
if [ ! -f "$LINUX_JDK_TAR" ]; then
- wget "$LINUX_JDK_URL";
+ curl -o "$LINUX_JDK_TAR" "$LINUX_JDK_URL";
fi;
tar -zxf "$LINUX_JDK_TAR"
fi;
if [ ! -d "$JFX_DIR" ]; then
if [ ! -f "$LINUX_JFX_ZIP" ]; then
- wget "$LINUX_JFX_URL";
+ curl -o "$LINUX_JFX_ZIP" "$LINUX_JFX_URL";
fi;
$UNZIP "$LINUX_JFX_ZIP"
fi;
+
+elif [ "$PLATFORM" == "mac" ]; then
+
+ JDK_DIR="$JDK_DIR.jdk" # Mac builds append .jdk
+ JDK_DIR_SHORT="$JDK_DIR_SHORT-mac"
+ JFX_DIR_SHORT="$JFX_DIR_SHORT-mac"
+
+ if [ ! -d "$JDK_DIR" ]; then
+ if [ ! -f "$MAC_JDK_TAR" ]; then
+ curl -o "$MAC_JDK_TAR" "$MAC_JDK_URL";
+ fi;
+ tar -zxf "$MAC_JDK_TAR"
+ fi;
+
+ if [ ! -d "$JFX_DIR" ]; then
+ if [ ! -f "$MAC_JFX_ZIP" ]; then
+ curl -o "$MAC_JFX_ZIP" "$MAC_JFX_URL";
+ fi;
+ $UNZIP "$MAC_JFX_ZIP"
+ fi;
+
else
echo "Valid platform argument required";
- echo "$0 windows | linux";
+ echo "$0 windows | linux | mac";
exit 1;
fi;
mkdir -p lib
if [ ! -f lib/$JSON_JAR ]; then
echo "Fetching JSON libs..."
- wget -O lib/$JSON_JAR $JSON_URL
+ curl -o lib/$JSON_JAR $JSON_URL
fi;
rm -rf "$JDK_DIR_SHORT" "$JFX_DIR_SHORT";
# Reference local JDK/JFX bundles.
JAVA_HOME="./java-jdk-linux"
JAVAFX_HOME="./javafx-sdk-linux"
+
+# Are we running on a mac?
+if [ $(uname) == 'Darwin' ]; then
+ JAVA_HOME="./java-jdk-mac/Contents/Home"
+ JAVAFX_HOME="./javafx-sdk-mac"
+fi;
+
JAFAFX_MODS="--module-path $JAVAFX_HOME/lib --add-modules=javafx.base,javafx.graphics,javafx.web"
JAVA=$JAVA_HOME/bin/java