記錄-sdkman 安裝jdk


注: 不能用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無法驗證服務器提供的證書。

有兩個選項可以讓它發揮作用:

  1. 用卷曲連用-k選項允許curl進行不安全連接,即curl不驗證證書。
  2. 將根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

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM