Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs references to Java 11 #5432

Merged
merged 4 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
# - Linux, macOS or similar *nix with standard tools like `make`
# - bitcoind and bitcoin-cli (`brew install bitcoin` on macOS)
# - JDK 10 to build and run Bisq binaries; see
# - JDK 11 to build and run Bisq binaries; see
# https://www.oracle.com/java/technologies/java-archive-javase10-downloads.html
BtcContributor marked this conversation as resolved.
Show resolved Hide resolved
#
#
Expand Down
4 changes: 2 additions & 2 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/idea-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Most Bisq contributors use IDEA for development. The following instructions have
1. In the `Import Project from Gradle` screen, check the `Use auto-import` option and click `OK`
1. When prompted whether to overwrite the existing `.idea` directory, click `Yes` (This step was not required with 2019.2 but is kept here in case you are running an older version)
1. In the `Project` tool window, right click on the root-level `.idea` folder, select `Git->Revert...` and click OK in the dialog that appears (to restore source-controlled `.idea` configuration files that get overwritten during project import)
1. If you did not yet setup JDK10 in IntelliJ, Go to `File->Project Structure->Project` and under the `Project SDK` option locate your JAVA_HOME folder, then in `Project language level` beneath select `10 - ...`. (JDK10 is no longer supported but you can still download it from the [archive](https://jdk.java.net/archive/))
1. Select JDK 10 for gradle as well. Go to `Preferences->Build, Execution, Deployment->Build Tools->Gradle` and select the JDK10 location for Gradle JVM
1. If you did not yet setup JDK11 in IntelliJ, Go to `File->Project Structure->Project` and under the `Project SDK` option locate your JAVA_HOME folder, then in `Project language level` beneath select `11 - ...`.
BtcContributor marked this conversation as resolved.
Show resolved Hide resolved
1. Select JDK 11 for gradle as well. Go to `Preferences->Build, Execution, Deployment->Build Tools->Gradle` and select the JDK11 location for Gradle JVM
1. Go to `Build->Build Project`. Everything should build cleanly. You should be able to run tests, run `main` methods in any component, etc.

> TIP: If you encounter compilation errors in IDEA related to the `protobuf.*` classes, it is probably because you didn't build Bisq at the command line as instructed above. You need to run the `generateProto` task in the `common` project. You can do this via the Gradle tool window in IDEA, or you can do it the command line with `./gradlew :common:generateProto`. Once you've done that, run `Build->Build Project` again and you should have no errors.
20 changes: 5 additions & 15 deletions scripts/install_java.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,26 @@ 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
goto SetEnvVars
)

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
Expand Down
23 changes: 11 additions & 12 deletions scripts/install_java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -52,24 +52,24 @@ 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
fi

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

Expand All @@ -80,4 +80,3 @@ case "${unameOut}" in
*)
esac
java -version