Update scripts to JDK 11

This commit is contained in:
BtcContributor 2021-04-22 17:16:00 +02:00 committed by Christoph Atteneder
parent e287fddc86
commit 4af614b9cc
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B
3 changed files with 18 additions and 29 deletions

View file

@ -43,14 +43,14 @@
1. You do _not_ need to install Gradle to build Bisq. The `gradlew` shell script will install it for you, if necessary.
2. Bisq currently works with JDK 10 and 11 only. JDK 12 and above are not supported. You can find out which
2. Bisq currently works with JDK 11 only. JDK 12 and above are not supported. You can find out which
version you have with:
```sh
javac -version
```
If your Java version is not 10 or 11, check out scripts in the [scripts](../scripts) directory (or online at https://github.com/bisq-network/bisq/tree/master/scripts).
If you do not have JDK 11 installed, check out scripts in the [scripts](../scripts) directory or download it manually from https://jdk.java.net/archive/.
## Running Bisq

View file

@ -25,9 +25,9 @@ cd /D "%~dp0"
title Install Java
set jdk_version=10.0.2
set jdk_version=11.0.2
set jdk_filename=openjdk-%jdk_version%_windows-x64_bin
set jdk_url=https://download.java.net/java/GA/jdk10/%jdk_version%/19aef61b38124481863b1413dce1855f/13/%jdk_filename%.tar.gz
set jdk_url=https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_windows-x64_bin.zip
if exist "%PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%" (
echo %PROGRAMFILES%\Java\openjdk\jdk-%jdk_version% already exists, skipping install
@ -35,26 +35,16 @@ if exist "%PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%" (
)
echo Downloading required files to %TEMP%
powershell -Command "Invoke-WebRequest %jdk_url% -OutFile $env:temp\%jdk_filename%.tar.gz"
if not exist "%TEMP%\7za920\7za.exe" (
:: Download 7zip ^(command line version^) in order to extract the tar.gz file since there is no native support in Windows
powershell -Command "Invoke-WebRequest https://www.7-zip.org/a/7za920.zip -OutFile $env:temp\7za920.zip"
powershell -Command "Expand-Archive $env:temp\7za920.zip -DestinationPath $env:temp\7za920 -Force"
)
powershell -Command "Invoke-WebRequest %jdk_url% -OutFile $env:temp\%jdk_filename%.zip"
echo Extracting and installing JDK to %PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%
"%TEMP%\7za920\7za.exe" x "%TEMP%\%jdk_filename%.tar.gz" -o"%TEMP%" -r -y
"%TEMP%\7za920\7za.exe" x "%TEMP%\%jdk_filename%.tar" -o"%TEMP%\openjdk-%jdk_version%" -r -y
powershell -Command "Expand-Archive $env:temp\%jdk_filename%.zip -DestinationPath %TEMP%\openjdk-%jdk_version% -Force"
md "%PROGRAMFILES%\Java\openjdk"
move "%TEMP%\openjdk-%jdk_version%\jdk-%jdk_version%" "%PROGRAMFILES%\Java\openjdk"
echo Removing downloaded files
if exist "%TEMP%\7za920.zip" (
del /Q %TEMP%\7za920.zip
)
rmdir /S /Q %TEMP%\openjdk-%jdk_version%
del /Q %TEMP%\%jdk_filename%.tar
del /Q %TEMP%\%jdk_filename%.tar.gz
del /Q %TEMP%\%jdk_filename%.zip
:SetEnvVars
echo Setting environment variables

View file

@ -15,9 +15,9 @@ set -e
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*)
JAVA_HOME=/usr/lib/jvm/openjdk-10.0.2
JDK_FILENAME=openjdk-10.0.2_linux-x64_bin.tar.gz
JDK_URL=https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_linux-x64_bin.tar.gz
JAVA_HOME=/usr/lib/jvm/openjdk-11.0.2
JDK_FILENAME=openjdk-11.0.2_linux-x64_bin.tar.gz
JDK_URL=https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
# Determine which package manager to use depending on the distribution
declare -A osInfo;
@ -52,13 +52,13 @@ case "${unameOut}" in
update-alternatives --set javac $JAVA_HOME/bin/javac
;;
Darwin*)
JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-10.0.2.jdk/Contents/Home
JDK_FILENAME=openjdk-10.0.2_osx-x64_bin.tar.gz
JDK_URL=https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_osx-x64_bin.tar.gz
JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home
JDK_FILENAME=openjdk-11.0.2_osx-x64_bin.tar.gz
JDK_URL=https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_osx-x64_bin.tar.gz
if [ ! -d "$JAVA_HOME" ]; then
if [[ $(command -v brew) == "" ]]; then
echo "Installing Hombrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Updating Homebrew"
brew update
@ -66,10 +66,10 @@ case "${unameOut}" in
brew install curl
curl -L -O $JDK_URL
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-10.0.2.jdk | sudo bash
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk | sudo bash
gunzip -c $JDK_FILENAME | tar xopf -
sudo mv jdk-10.0.2.jdk/* /Library/Java/JavaVirtualMachines/openjdk-10.0.2.jdk
sudo rmdir jdk-10.0.2.jdk
sudo mv jdk-11.0.2.jdk/* /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk
sudo rmdir jdk-11.0.2.jdk
rm $JDK_FILENAME
fi
@ -80,4 +80,3 @@ case "${unameOut}" in
*)
esac
java -version