mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Merge branch 'master' into allow-spending-unconfirmed-bsq-utxs
This commit is contained in:
commit
9475cf2897
18 changed files with 108 additions and 60 deletions
|
@ -1411,9 +1411,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Lockup
|
||||
dao.bond.reputation.lockup.headline=Confirm lockup transaction
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.headline=Confirm unlock transaction
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
|
||||
dao.bond.allBonds.header=All bonds
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Sperren
|
||||
dao.bond.reputation.lockup.headline=Sperrung-Transaktion bestätigen
|
||||
dao.bond.reputation.lockup.details=Gesperrter Betrag: {0}\nSperr Zeit: {1} Blöcke(Block)\n\nSind Sie sicher, dass Sie fortfahren möchten?
|
||||
dao.bond.reputation.lockup.details=Gesperrter Betrag: {0}\nSperr Zeit: {1} Blöcke(Block) (≈{2})\n\nSind Sie sicher, dass Sie fortfahren möchten?
|
||||
dao.bond.reputation.unlock.headline=Entsperrung-Transaktion bestätigen
|
||||
dao.bond.reputation.unlock.details=Entsperrter Betrag: {0}\nSperr Zeit: {1} Blöcke(Block)\n\nSind Sie sicher, dass Sie fortfahren möchten?
|
||||
dao.bond.reputation.unlock.details=Entsperrter Betrag: {0}\nSperr Zeit: {1} Blöcke(Block) (≈{2})\n\nSind Sie sicher, dass Sie fortfahren möchten?
|
||||
|
||||
dao.bond.allBonds.header=Alle Pfänder
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Lockup
|
||||
dao.bond.reputation.lockup.headline=Confirm lockup transaction
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.headline=Confirm unlock transaction
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
|
||||
dao.bond.allBonds.header=All bonds
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Bloquear
|
||||
dao.bond.reputation.lockup.headline=Confirmar transacción de bloqueo
|
||||
dao.bond.reputation.lockup.details=Cantidad bloqueada: {0}\nTiempo de bloqueo: {1} bloque(s)\n\nEstá seguro de que quiere proceder?
|
||||
dao.bond.reputation.lockup.details=Cantidad bloqueada: {0}\nTiempo de bloqueo: {1} bloque(s) (≈{2})\n\nEstá seguro de que quiere proceder?
|
||||
dao.bond.reputation.unlock.headline=Confirmar desbloqueo de transacción
|
||||
dao.bond.reputation.unlock.details=Cantidad a desbloquear: {0}\nTiempo de bloqueo: {1} bloque(s)\n\nEstá seguro de que quiere proceder?
|
||||
dao.bond.reputation.unlock.details=Cantidad a desbloquear: {0}\nTiempo de bloqueo: {1} bloque(s) (≈{2})\n\nEstá seguro de que quiere proceder?
|
||||
|
||||
dao.bond.allBonds.header=Todos los bonos
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=داده تصادفی
|
|||
dao.bond.reputation.hash=تابع درهم ساز (هش)
|
||||
dao.bond.reputation.lockupButton=قفل کردن
|
||||
dao.bond.reputation.lockup.headline=تایید تراکنش قفل کردن وجه
|
||||
dao.bond.reputation.lockup.details=مقدار وجه قفل شده: {0}\nمدت زمان قفل ماندن: ({1}) بلاک\n\nآیا از ادامه دادن مطمئنید؟
|
||||
dao.bond.reputation.lockup.details=مقدار وجه قفل شده: {0}\nمدت زمان قفل ماندن: ({1}) بلاک (≈{2})\n\nآیا از ادامه دادن مطمئنید؟
|
||||
dao.bond.reputation.unlock.headline=تایید تراکنش رها کردن وجه
|
||||
dao.bond.reputation.unlock.details=مقدار رها شدن وجه: {0}\nمدت زمان قفل شدن: ({1}) بلاک\n\nآیا از ادامه دادن مطمئنید؟
|
||||
dao.bond.reputation.unlock.details=مقدار رها شدن وجه: {0}\nمدت زمان قفل شدن: ({1}) بلاک (≈{2})\n\nآیا از ادامه دادن مطمئنید؟
|
||||
|
||||
dao.bond.allBonds.header=همه ضمانتها
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Lockup
|
||||
dao.bond.reputation.lockup.headline=Confirm lockup transaction
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.headline=Confirm unlock transaction
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
|
||||
dao.bond.allBonds.header=All bonds
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Lockup
|
||||
dao.bond.reputation.lockup.headline=Confirm lockup transaction
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.headline=Confirm unlock transaction
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
|
||||
dao.bond.allBonds.header=All bonds
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Sal
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Travar
|
||||
dao.bond.reputation.lockup.headline=Confirm lockup transaction
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.headline=Confirm unlock transaction
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
|
||||
dao.bond.allBonds.header=All bonds
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Lockup
|
||||
dao.bond.reputation.lockup.headline=Confirm lockup transaction
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.headline=Confirm unlock transaction
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
|
||||
dao.bond.allBonds.header=All bonds
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Соль
|
|||
dao.bond.reputation.hash=Хеш
|
||||
dao.bond.reputation.lockupButton=Запереть
|
||||
dao.bond.reputation.lockup.headline=Подтвердить транзакцию блокировки
|
||||
dao.bond.reputation.lockup.details=Запереть сумму: {0}\nВремя блокировки: {1} блок(ов) \n\nДействительно желаете продолжить?
|
||||
dao.bond.reputation.lockup.details=Запереть сумму: {0}\nВремя блокировки: {1} блок(ов) (≈{2})\n\nДействительно желаете продолжить?
|
||||
dao.bond.reputation.unlock.headline=Подтвердить транзакцию разблокировки
|
||||
dao.bond.reputation.unlock.details=Отпереть сумму: {0}\nВремя блокировки: {1} блок(ов)\n\nДействительно желаете продолжить?
|
||||
dao.bond.reputation.unlock.details=Отпереть сумму: {0}\nВремя блокировки: {1} блок(ов) (≈{2})\n\nДействительно желаете продолжить?
|
||||
|
||||
dao.bond.allBonds.header=Все гарантийные депозиты
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Lockup
|
||||
dao.bond.reputation.lockup.headline=Confirm lockup transaction
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.headline=Confirm unlock transaction
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
|
||||
dao.bond.allBonds.header=All bonds
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=ข้อมูลแบบสุ่ม
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=ล็อค
|
||||
dao.bond.reputation.lockup.headline=ยืนยันล็อคการทำรายการ
|
||||
dao.bond.reputation.lockup.details=ล็อคจำนวน: {0}\nล็อคเวลา: {1} บล็อก\n\nคุณแน่ใจหรือไม่ว่าต้องการดำเนินการต่อ?
|
||||
dao.bond.reputation.lockup.details=ล็อคจำนวน: {0}\nล็อคเวลา: {1} บล็อก (≈{2})\n\nคุณแน่ใจหรือไม่ว่าต้องการดำเนินการต่อ?
|
||||
dao.bond.reputation.unlock.headline=ยืนยันการปลดล็อกธุรกรรม
|
||||
dao.bond.reputation.unlock.details=จำนวนที่ปลดล็อค: {0}\nเวลาในการล็อค: {1} บล็อก (s)\n\nคุณแน่ใจหรือไม่ว่าต้องการดำเนินการต่อ
|
||||
dao.bond.reputation.unlock.details=จำนวนที่ปลดล็อค: {0}\nเวลาในการล็อค: {1} บล็อก (s) (≈{2})\n\nคุณแน่ใจหรือไม่ว่าต้องการดำเนินการต่อ
|
||||
|
||||
dao.bond.allBonds.header=การค้ำประกันทั้งหมด
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Khóa
|
||||
dao.bond.reputation.lockup.headline=Xác nhận giao dịch khóa
|
||||
dao.bond.reputation.lockup.details=Số lượng khóa: {0}\nThời gian khóa: {1} khối\n\nBạn có thực sự muốn tiếp tục?
|
||||
dao.bond.reputation.lockup.details=Số lượng khóa: {0}\nThời gian khóa: {1} khối (≈{2})\n\nBạn có thực sự muốn tiếp tục?
|
||||
dao.bond.reputation.unlock.headline=Xác nhận giao dịch mở khóa
|
||||
dao.bond.reputation.unlock.details=Số lượng mở khóa: {0}\nThời gian mở khóa: {1} khối\n\nBạn có thực sự muốn tiếp tục?
|
||||
dao.bond.reputation.unlock.details=Số lượng mở khóa: {0}\nThời gian mở khóa: {1} khối (≈{2})\n\nBạn có thực sự muốn tiếp tục?
|
||||
|
||||
dao.bond.allBonds.header=Tất cả cách tài sản đảm bảo
|
||||
|
||||
|
|
|
@ -1227,9 +1227,9 @@ dao.bond.reputation.salt=Salt
|
|||
dao.bond.reputation.hash=Hash
|
||||
dao.bond.reputation.lockupButton=Lockup
|
||||
dao.bond.reputation.lockup.headline=Confirm lockup transaction
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.lockup.details=Lockup amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.headline=Confirm unlock transaction
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nLockup time: {1} block(s)\n\nAre you sure you want to proceed?
|
||||
dao.bond.reputation.unlock.details=Unlock amount: {0}\nUnlock time: {1} block(s) (≈{2})\n\nAre you sure you want to proceed?
|
||||
|
||||
dao.bond.allBonds.header=All bonds
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import bisq.core.dao.state.model.blockchain.TxOutput;
|
|||
import bisq.core.dao.state.model.governance.BondedRoleType;
|
||||
import bisq.core.dao.state.model.governance.Role;
|
||||
import bisq.core.locale.Res;
|
||||
import bisq.core.util.BSFormatter;
|
||||
import bisq.core.util.BsqFormatter;
|
||||
|
||||
import bisq.network.p2p.P2PService;
|
||||
|
@ -100,10 +101,13 @@ public class BondingViewUtils {
|
|||
Consumer<String> resultHandler) {
|
||||
if (GUIUtil.isReadyForTxBroadcast(p2PService, walletsSetup)) {
|
||||
if (!DevEnv.isDevMode()) {
|
||||
BSFormatter formatter = new BSFormatter();
|
||||
String duration = formatter.formatDurationAsWords(lockupTime * 10 * 60 * 1000L, false, false);
|
||||
new Popup<>().headLine(Res.get("dao.bond.reputation.lockup.headline"))
|
||||
.confirmation(Res.get("dao.bond.reputation.lockup.details",
|
||||
bsqFormatter.formatCoinWithCode(lockupAmount),
|
||||
lockupTime
|
||||
lockupTime,
|
||||
duration
|
||||
))
|
||||
.actionButtonText(Res.get("shared.yes"))
|
||||
.onAction(() -> publishLockupTx(hash, lockupAmount, lockupTime, lockupReason, resultHandler))
|
||||
|
@ -143,10 +147,13 @@ public class BondingViewUtils {
|
|||
|
||||
try {
|
||||
if (!DevEnv.isDevMode()) {
|
||||
BSFormatter formatter = new BSFormatter();
|
||||
String duration = formatter.formatDurationAsWords(lockTime * 10 * 60 * 1000L, false, false);
|
||||
new Popup<>().headLine(Res.get("dao.bond.reputation.unlock.headline"))
|
||||
.confirmation(Res.get("dao.bond.reputation.unlock.details",
|
||||
bsqFormatter.formatCoinWithCode(unlockAmount),
|
||||
lockTime
|
||||
lockTime,
|
||||
duration
|
||||
))
|
||||
.actionButtonText(Res.get("shared.yes"))
|
||||
.onAction(() -> publishUnlockTx(lockupTxId, resultHandler))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Building Bisq
|
||||
|
||||
_You will need [OpenJDK 10](https://jdk.java.net/10/) installed and configured as the default system JDK to complete the following instructions. See the `scripts` directory for scripts that can be used to install and configure the JDK automatically._
|
||||
|
||||
> TIP: If you are on MacOS, run the script with this command `. scripts/install_java.sh`.
|
||||
|
||||
## Clone
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ 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`
|
||||
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 - ...`.
|
||||
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 `io.bisq.generated.protobuffer.PB` class, 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.
|
||||
|
|
|
@ -3,40 +3,80 @@
|
|||
# It will also configure it as the default system JDK.
|
||||
# If you need to change to another default JDK for another purpose later, you can use the
|
||||
# following commands and select the default JDK:
|
||||
# Linux:
|
||||
# update-alternatives --config java
|
||||
# update-alternatives --config javac
|
||||
# MacOS:
|
||||
# echo 'export JAVA_HOME=/Library/Java/JavaVirtualMachines/<ENTER_NEW_JDK>/Contents/Home' >>~/.bash_profile
|
||||
# echo 'export PATH=$JAVA_HOME/bin:$PATH' >>~/.bash_profile
|
||||
# source ~/.bash_profile
|
||||
|
||||
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
|
||||
|
||||
# Determine which package manager to use depending on the distribution
|
||||
declare -A osInfo;
|
||||
osInfo[/etc/redhat-release]=yum
|
||||
osInfo[/etc/arch-release]=pacman
|
||||
osInfo[/etc/gentoo-release]=emerge
|
||||
osInfo[/etc/SuSE-release]=zypp
|
||||
osInfo[/etc/debian_version]=apt-get
|
||||
for f in ${!osInfo[@]}
|
||||
do
|
||||
if [[ -f $f ]]; then
|
||||
PACKAGE_MANAGER=${osInfo[$f]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
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
|
||||
|
||||
if [ ! -d "$JAVA_HOME" ]; then
|
||||
# Ensure curl is installed since it may not be
|
||||
$PACKAGE_MANAGER -y install curl
|
||||
# Determine which package manager to use depending on the distribution
|
||||
declare -A osInfo;
|
||||
osInfo[/etc/redhat-release]=yum
|
||||
osInfo[/etc/arch-release]=pacman
|
||||
osInfo[/etc/gentoo-release]=emerge
|
||||
osInfo[/etc/SuSE-release]=zypp
|
||||
osInfo[/etc/debian_version]=apt-get
|
||||
|
||||
curl -L -O $JDK_URL
|
||||
mkdir -p $JAVA_HOME
|
||||
tar -zxf $JDK_FILENAME -C $JAVA_HOME --strip 1
|
||||
rm $JDK_FILENAME
|
||||
for f in ${!osInfo[@]}
|
||||
do
|
||||
if [[ -f $f ]]; then
|
||||
PACKAGE_MANAGER=${osInfo[$f]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 2000
|
||||
update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 2000
|
||||
fi
|
||||
if [ ! -d "$JAVA_HOME" ]; then
|
||||
# Ensure curl is installed since it may not be
|
||||
$PACKAGE_MANAGER -y install curl
|
||||
|
||||
update-alternatives --set java $JAVA_HOME/bin/java
|
||||
update-alternatives --set javac $JAVA_HOME/bin/javac
|
||||
curl -L -O $JDK_URL
|
||||
mkdir -p $JAVA_HOME
|
||||
tar -zxf $JDK_FILENAME -C $JAVA_HOME --strip 1
|
||||
rm $JDK_FILENAME
|
||||
|
||||
update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 2000
|
||||
update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 2000
|
||||
fi
|
||||
|
||||
update-alternatives --set java $JAVA_HOME/bin/java
|
||||
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
|
||||
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)"
|
||||
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
|
||||
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
|
||||
rm $JDK_FILENAME
|
||||
fi
|
||||
|
||||
echo export JAVA_HOME=$JAVA_HOME >>~/.bash_profile
|
||||
echo export PATH=$JAVA_HOME/bin:$PATH >>~/.bash_profile
|
||||
source ~/.bash_profile
|
||||
;;
|
||||
*) machine="UNKNOWN:${unameOut}"
|
||||
esac
|
||||
java -version
|
||||
|
|
Loading…
Add table
Reference in a new issue