注: 不能用cmd 运行。具体的忘了。还要安装sdkman。
1. sdk help 查看命令
2.sdk list java 查看java jdk
3.sdk install java 8.0.282.j9-adpt 安装jdk 下边有安装命令提示。最后一栏是可选jdk版本
4.查看jdk安装目录
附加:遇到一个get请求参数问题,把&当成参数 & = %26。
软件:(好用的)综合性桌面搜索软件(支持xp、win7、win8、win10及macOS系统)->火萤酱
idea ctrl+shift+F9 重新加载.java文件,不需要重启项目。MobaXterm 终端工具。
记录-重装电脑安装sdkman时遇到的问题
git bash 安装sdkman
curl -s "https://get.sdkman.io" | bash
1.zip 问题。
$ curl -s "https://get.sdkman.io" | bash -+syyyyyyys: `/yho:` -yd. `/yh/` +m. .oho. hy .` .sh/` :N` `-/o` `+dyyo:. .yh:` `M- `-/osysoym :hs` `-+sys: hhyssssssssy+ .sh:` `N: ms/-`` yy.yh- -hy. `.N-````````+N. `od/` `N- -/oM- ddd+` `sd: hNNm -N: :do` .M. dMMM- `ms. /d+` `NMMs `do .yy- :N` ```mMMM. - -hy. /MMM: yh `+d+` `:/oo/` `-/osyh/ossssssdNMM` .sh: yMMN` /m. -dh- :ymNMMMMy `-/shmNm-`:N/-.`` `.sN /N- `NMMy .m/ `oNs` -hysosmMMMMydmNmds+-.:ohm : sd` :MMM/ yy .hN+ /d: -MMMmhs/-.` .MMMh .ss+- `yy` sMMN` :N. :mN/ `N/ `o/-` :MMMo +MMMN- .` `ds mMMh do /NN/ `N+....--:/+oooosooo+:sMMM: hMMMM: `my .m+ -MMM+ :N. /NMo -+ooooo+/:-....`...:+hNMN. `NMMMd` .MM/ -m: oMMN. hs -NMd` :mm -MMMm- .s/ -MMm. /m- mMMd -N. `mMM/ .- /MMh. -dMo -MMMy od. .MMMs..---yh +MMM. sNo`.sNMM+ :MMMM/ sh`+MMMNmNm+++- mMMM- /--ohmMMM+ :MMMMm. `hyymmmdddo MMMMh. `````-+yy/`yMMM/ :MMMMMy -sm:.``..-:-.` dMMMMmo-.``````..-:/osyhddddho. `+shdh+. hMMM: :MmMMMM/ ./yy/` `:sys+/+sh/ .dMMMMMMmdddddmmNMMMNNNNNMMMMMs sNdo- dMMM- `-/yd/MMMMm-:sy+. :hs- /N` `/ymNNNNNNNmmdys+/::----/dMMm: +m- mMMM+ohmo/.` sMMMMdo- .om: `sh `.-----+/.` `.-+hh/` `od. NMMNmds/ `mmy:` +mMy `:yy. /moyso+//+ossso:. .yy` `dy+:` .. :MMMN+---/oys: /+m: `.-:::-` /d+ +MMMMMMMNh:` +MN/ -yh. `+hddhy+. /MM+ .sh: :NMo -sh/ -NMs `/yy: .NMy `:sh+. `mMm` ./yds- `dMMMmyo:-.````.-:oymNy:` +NMMMMMMMMMMMMMMMMms:` -+shmNMMMNmdy+:` Now attemptinginstallation... Looking for a previous installation of SDKMAN... Looking for unzip... Looking for zip... which: no zip in (/c/Users/mengxianzhu/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/mengxianzhu/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS:/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/WINDOWS/System32/OpenSSH:/c/Program Files/PuTTY:/c/Program Files (x86)/MATLAB/MATLAB Compiler Runtime/v714/runtime/win32:/c/Program Files/MATLAB/R2018a/runtime/win64:/c/Program Files/MATLAB/R2018a/bin:/cmd:/c/Program Files/TortoiseGit/bin:/c/Program Files/Microsoft Windows Performance Toolkit:/c/Users/mengxianzhu/AppData/Local/Android/Sdk/tools:/c/Users/mengxianzhu/AppData/Local/Android/Sdk/platform-tools:/c/Users/mengxianzhu/AppData/Local/Android/Sdk/tools/bin:/c/Program Files/Java/jdk1.8.0_201/bin:/c/Program Files/Java/jdk1.8.0_201/jre/bin:/c/Users/mengxianzhu/AppData/Local/Microsoft/WindowsApps:/c/Users/mengxianzhu/AppData/Local/Programs/MicrosoftVS Code/bin:/usr/bin/vendor_perl:/usr/bin/core_perl) Not found. ====================================================================================================== Please install zip on your system using your favourite package manager. Restart after installing zip. ======================================================================================================
把7-zip 的7z.exe 复制重命名到Git Bash下mingw\bin目录下 不起作用。
没办法自能 照着教程
找到这个地址:https://sourceforge.net/projects/gnuwin32/files/
这里有很多支持的MinGW环境的软件,搜索zip即可。
下载完zip-3.0-bin.zip之后,把里面的zip.exe复制到Git Bash下mingw\bin目录下(根据自己的安装目录如:C:\softs\Git\mingw\bin,似乎放到usr\bin也可以)
2.在运行
curl -s "https://get.sdkman.io" | bash
遇到curl SSL问题curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above. [/c/Users/Administrator/.sdkman/tmp/sdkman-5.11.0+644.zip] End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of /c/Users/Administrator/.sdkman/tmp/sdkman-5.11.0+644.zip or /c/Users/Administrator/.sdkman/tmp/sdkman-5.11.0+644.zip.zip, and cannot find /c/Users/Administrator/.sdkman/tmp/sdkman-5.11.0+644.zip.ZIP, period. Downloaded zip archive corrupt. Are you connected to the internet? If problems persist, please ask for help on our Slack: * easy sign up: https://slack.sdkman.io/ * report on channel: https://sdkman.slack.com/app_redirect?channel=user-issues
因为curl无法验证服务器提供的证书。
有两个选项可以让它发挥作用:
- 用卷曲连用
-k
选项允许curl进行不安全连接,即curl不验证证书。 - 将根CA(签名服务器证书的CA)添加到
etc/ssl/certs/ca-certificates.crt
你应该使用选项2,因为这是确保连接到安全ftp服务器的选项。
将根CA(签名服务器证书的CA)添加到etc/ssl/certs/ca-certificates.crt
Mac OS X 添加证书: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/new-root-certificate.crt 移除证书: sudo security delete-certificate -c "<name of existing certificate>" Windows 添加证书: certutil -addstore -f "ROOT" new-root-certificate.crt 移除证书: certutil -delstore "ROOT" serial-number-hex Linux (Ubuntu, Debian) 添加证书: 复制 CA 文件到目录: /usr/local/share/ca-certificates/ 执行: sudo cp foo.crt /usr/local/share/ca-certificates/foo.crt 更新 CA 证书库: sudo update-ca-certificates 移除证书: Remove your CA. Update the CA store: sudo update-ca-certificates --fresh Restart Kerio Connect to reload the certificates in the 32-bit versions or Debian 7. Linux (CentOs 6) 添加证书: 安装 ca-certificates package: yum install ca-certificates 启用dynamic CA configuration feature: update-ca-trust force-enable Add it as a new file to /etc/pki/ca-trust/source/anchors/: cp foo.crt /etc/pki/ca-trust/source/anchors/ 执行: update-ca-trust extract Restart Kerio Connect to reload the certificates in the 32-bit version.
地址不稳定可以多跑几遍安装成功是这样子的
$ curl -s "https://get.sdkman.io" | bash -+syyyyyyys: `/yho:` -yd. `/yh/` +m. .oho. hy .` .sh/` :N` `-/o` `+dyyo:. .yh:` `M- `-/osysoym :hs` `-+sys: hhyssssssssy+ .sh:` `N: ms/-`` yy.yh- -hy. `.N-````````+N. `od/` `N- -/oM- ddd+` `sd: hNNm -N: :do` .M. dMMM- `ms. /d+` `NMMs `do .yy- :N` ```mMMM. - -hy. /MMM: yh `+d+` `:/oo/` `-/osyh/ossssssdNMM` .sh: yMMN` /m. -dh- :ymNMMMMy `-/shmNm-`:N/-.`` `.sN /N- `NMMy .m/ `oNs` -hysosmMMMMydmNmds+-.:ohm : sd` :MMM/ yy .hN+ /d: -MMMmhs/-.` .MMMh .ss+- `yy` sMMN` :N. :mN/ `N/ `o/-` :MMMo +MMMN- .` `ds mMMh do /NN/ `N+....--:/+oooosooo+:sMMM: hMMMM: `my .m+ -MMM+ :N. /NMo -+ooooo+/:-....`...:+hNMN. `NMMMd` .MM/ -m: oMMN. hs -NMd` :mm -MMMm- .s/ -MMm. /m- mMMd -N. `mMM/ .- /MMh. -dMo -MMMy od. .MMMs..---yh +MMM. sNo`.sNMM+ :MMMM/ sh`+MMMNmNm+++- mMMM- /--ohmMMM+ :MMMMm. `hyymmmdddo MMMMh. ```` `-+yy/`yMMM/ :MMMMMy -sm:.``..-:-.` dMMMMmo-.``````..-:/osyhddddho. `+shdh+. hMMM: :MmMMMM/ ./yy/` `:sys+/+sh/ .dMMMMMMmdddddmmNMMMNNNNNMMMMMs sNdo- dMMM- `-/yd/MMMMm-:sy+. :hs- /N` `/ymNNNNNNNmmdys+/::----/dMMm: +m- mMMM+ohmo/.` sMMMMdo- .om: `sh `.-----+/.` `.-+hh/` `od. NMMNmds/ `mmy:` +mMy `:yy. /moyso+//+ossso:. .yy` `dy+:` .. :MMMN+---/oys: /+m: `.-:::-` /d+ +MMMMMMMNh:` +MN/ -yh. `+hddhy+. /MM+ .sh: :NMo -sh/ -NMs `/yy: .NMy `:sh+. `mMm` ./yds- `dMMMmyo:-.````.-:oymNy:` +NMMMMMMMMMMMMMMMMms:` -+shmNMMMNmdy+:` Now attempting installation... Looking for a previous installation of SDKMAN... Looking for unzip... Looking for zip... Looking for curl... Looking for sed... Installing SDKMAN scripts... Create distribution directories... Getting available candidates... Prime the config file... Download script archive... ######################################################################## 100.0% Extract script archive... Install scripts... Set version to 5.7.4+362 ... Attempt update of interactive bash profile on regular UNIX... Added sdkman init snippet to /c/Users/gary.fu/.bashrc Attempt update of zsh profile... Updated existing /c/Users/gary.fu/.zshrc All done! Please open a new terminal, or run the following in the existing one: source "/c/Users/gary.fu/.sdkman/bin/sdkman-init.sh" Then issue the following command: sdk help Enjoy!!!
现在重新打开一个Git Bash或者执行下面的命令就可以把sdkman加入到PATH中,然后就可以使用sdk命令了
source "$HOME/.sdkman/bin/sdkman-init.sh"
使用sdk version可以查看到sdk的版本了
sdk version