{"id":29,"date":"2021-01-11T19:39:05","date_gmt":"2021-01-11T11:39:05","guid":{"rendered":"http:\/\/mengstudy.com\/?p=29"},"modified":"2021-01-11T19:39:05","modified_gmt":"2021-01-11T11:39:05","slug":"windows%e4%b8%8b%e5%ae%89%e8%a3%85sdkman","status":"publish","type":"post","link":"https:\/\/fugary.com\/?p=29","title":{"rendered":"Windows\u4e0b\u5b89\u88c5SDKMAN"},"content":{"rendered":"<p>SDKMAN\uff08\u8f6f\u4ef6\u5f00\u53d1\u5305\u7ba1\u7406\u5668\uff09\u53ef\u4ee5\u5bf9\u5404\u79cd\u5404\u6837\u7684\u4e8c\u8fdb\u5236SDK\u5305\u8fdb\u884c\u7248\u672c\u7ba1\u7406\uff0c\u5305\u62ecGroovy\u548cJDK\u7b49\u3002<\/p>\n<p>\u76ee\u524dMacOS\u548cLinux\u652f\u6301\u6bd4\u8f83\u597d\uff0c\u5b89\u88c5\u6bd4\u8f83\u65b9\u4fbf\uff0c\u4e0d\u8fc7\u5bf9\u4e8eWindows\u5b89\u88c5\u76f8\u5bf9\u6765\u8bb2\u6709\u70b9\u9ebb\u70e6\u3002<\/p>\n<h3>Windows\u4e0b\u5b89\u88c5\u9009\u62e9<\/h3>\n<p>\u5b98\u7f51\u6587\u6863\u5730\u5740\uff1ahttps:\/\/sdkman.io\/install<\/p>\n<p>\u603b\u4f53\u6765\u8bb2\uff0cWindows\u4e0b\u5b89\u88c5\u9700\u8981\u6709Linux\u73af\u5883\uff0c\u5b98\u7f51\u63d0\u4f9b\u4e09\u79cd\u5728Windows\u4e0b\u5b89\u88c5\u7684\u65b9\u5f0f\uff1a<\/p>\n<ol>\n<li>\u5b89\u88c5<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\/install-win10\">Windows Linux Subsystem<\/a> (WLS)\u548c\u5176\u4ed6\u4e00\u4e9b\u5de5\u5177<\/li>\n<li>\u5b89\u88c5<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.cygwin.com\/install.html\">Cygwin<\/a>\u4ee5\u53ca\u4e00\u4e9b\u5de5\u5177<\/li>\n<li>\u5b89\u88c5<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/git-scm.com\/download\/win\">Git Bash for Windows<\/a>\uff0c\u5305\u542b<a class=\"wp-editor-md-post-content-link\" href=\"http:\/\/www.mingw.org\/\">MinGW<\/a>\uff08Minimalist GNU for Windows\uff09\uff0c\u4ee5\u53ca\u4e00\u4e9b\u5de5\u5177\u3002<\/li>\n<\/ol>\n<p>\u76ee\u524d\u770b\u4e09\u79cd\u65b9\u5f0f\u90fd\u9700\u8981\u5728Windows\u4e0b\u5b89\u88c5\u4e00\u4e2a\u7b80\u5355Linux\u7684\u73af\u5883\uff0c\u4ee5\u53ca\u4e00\u4e9b\u5e38\u7528\u7684\u5de5\u5177<\/p>\n<p>\u672c\u6587\u4ee5\u7b2c\u4e09\u79cd\uff0cGit Bash\u4e3a\u5b89\u88c5\u65b9\u5f0f\uff0c\u56e0\u4e3a\u4e00\u822c\u5f00\u53d1\u5df2\u7ecf\u4f7f\u7528\u4e86Git\u4f5c\u4e3a\u7248\u672c\u7ba1\u7406\u5de5\u5177\uff0c\u5b89\u88c5Git\u5ba2\u6237\u7aef\u7684\u65f6\u5019\u53ef\u4ee5\u4e00\u8d77\u5b89\u88c5Git Bash\u3002<\/p>\n<h3>\u5b89\u88c5Git Bash<\/h3>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/git-scm.com\/download\/win\uff08\u56fd\u5185\u53ef\u80fd\u88ab\u5899\uff09<\/p>\n<p>\u4e0b\u8f7d\u5730\u5740\uff08\u6dd8\u5b9d\u955c\u50cf\uff09\uff1ahttps:\/\/npm.taobao.org\/mirrors\/git-for-windows\/<\/p>\n<p>\u5982\uff1ahttps:\/\/npm.taobao.org\/mirrors\/git-for-windows\/v2.26.0.windows.1\/Git-2.26.0-64-bit.exe<\/p>\n<p>\u5b89\u88c5\u57fa\u672c\u5b89\u88c5\u9ed8\u8ba4\u9009\u9879\u5373\u53ef<\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324110757.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324110757.png\" alt=\"\" \/><\/div><\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324110745.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324110745.png\" alt=\"\" \/><\/div><\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u7528\u5f00\u59cb\u83dc\u5355\u6216\u8005\u684c\u9762\u7684\u3010Git Bash\u3011\u56fe\u6807\u5f00\u542fGit Bash\u547d\u4ee4\u884c\u5de5\u5177\u3002<\/p>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324110848.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324110848.png\" alt=\"\" \/><\/div><\/p>\n<h3>\u5b89\u88c5\u5176\u4ed6\u5de5\u5177<\/h3>\n<p>\u8981sdkman\u80fd\u6b63\u5e38\u5b89\u88c5\uff0c\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5176\u4ed6\u5de5\u5177\uff0c\u770b\u4fe1\u606f\u63d0\u793a\u4e3b\u8981\u6709curl\uff0cunzip\uff0czip\u548csed\uff0c\u7531\u4e8eGit Bash\u81ea\u5e26\u7684MinGW\u662f\u7b80\u5355\u7248\u672c\u7684\uff0c\u5df2\u7ecf\u6709\u90e8\u5206\u8f6f\u4ef6\u5df2\u7ecf\u5b89\u88c5\u4e0a\u4e86<\/p>\n<p>\u76ee\u524d\u770bcurl\uff0cuzip\uff0csed\u5df2\u7ecf\u5b89\u88c5\u4e0a\u4e86\uff1a<\/p>\n<pre><code class=\"language-bash line-numbers\">curl -V\nunzip -v\nsed --version\n<\/code><\/pre>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324111846.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324111846.png\" alt=\"\" \/><\/div><\/p>\n<p>\u7f3a\u5c11zip\uff0c\u5982\u679c\u5c1d\u8bd5\u5b89\u88c5sdkman\u4f1a\u62a5\u9519<\/p>\n<pre><code class=\"language-bash line-numbers\">curl -s \"https:\/\/get.sdkman.io\" | bash\n<\/code><\/pre>\n<blockquote><p>\n  Please install zip on your system using your favourite package manager.<\/p>\n<p>  Restart after installing zip.\n<\/p><\/blockquote>\n<p>\u9700\u8981\u5b89\u88c5zip\u8f6f\u4ef6\uff0c\u73b0\u5728\u53ef\u4ee5\u5148\u5b89\u88c5\u5b8c\u6574\u7248MinGW\u901a\u8fc7mingw-get\u5b89\u88c5\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u627ezip\u8f6f\u4ef6\u653e\u5230MinGW\u76ee\u5f55\u4e0b\u3002<\/p>\n<p>\u76f4\u63a5\u627ezip\u8f6f\u4ef6\uff1a<\/p>\n<p>\u627e\u5230\u8fd9\u4e2a\u5730\u5740\uff1ahttps:\/\/sourceforge.net\/projects\/gnuwin32\/files\/<\/p>\n<p>\u8fd9\u91cc\u6709\u5f88\u591a\u652f\u6301\u7684MinGW\u73af\u5883\u7684\u8f6f\u4ef6\uff0c\u641c\u7d22zip\u5373\u53ef\u3002<\/p>\n<p>https:\/\/sourceforge.net\/projects\/gnuwin32\/files\/zip\/3.0\/zip-3.0-bin.zip\/download<\/p>\n<p>\u4e0b\u8f7d\u5b8czip-3.0-bin.zip\u4e4b\u540e\uff0c\u628a\u91cc\u9762\u7684zip.exe\u590d\u5236\u5230Git Bash\u4e0bmingw\\bin\u76ee\u5f55\u4e0b\uff08\u6839\u636e\u81ea\u5df1\u7684\u5b89\u88c5\u76ee\u5f55\u5982\uff1aC:\\softs\\Git\\mingw\\bin\uff0c\u4f3c\u4e4e\u653e\u5230usr\\bin\u4e5f\u53ef\u4ee5\uff09<\/p>\n<h3>\u5b89\u88c5SDKMAN<\/h3>\n<p>\u5de5\u5177\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c\u53ef\u4ee5\u5f00\u59cb\u5b89\u88c5SDKMAN\u4e86\uff1a<\/p>\n<pre><code class=\"language-bash line-numbers\">curl -s \"https:\/\/get.sdkman.io\" | bash\n<\/code><\/pre>\n<p>\u6ce8\u610f\u8fd9\u4e2a\u5730\u5740\u4e0d\u662f\u5f88\u7a33\u5b9a\uff0c\u4e5f\u6709\u4e00\u5b9a\u51e0\u7387\u7f51\u7edc\u8fde\u63a5\u5931\u8d25\uff0c\u53ef\u4ee5\u591a\u8bd5\u8bd5\u3002<\/p>\n<pre><code class=\"language-bash line-numbers\">$ curl -s \"https:\/\/get.sdkman.io\" | bash\n\n                                -+syyyyyyys:\n                            `\/yho:`       -yd.\n                         `\/yh\/`             +m.\n                       .oho.                 hy                          .`\n                     .sh\/`                   :N`                `-\/o`  `+dyyo:.\n                   .yh:`                     `M-          `-\/osysoym  :hs` `-+sys:      hhyssssssssy+\n                 .sh:`                       `N:          ms\/-``  yy.yh-      -hy.    `.N-````````+N.\n               `od\/`                         `N-       -\/oM-      ddd+`     `sd:     hNNm        -N:\n              :do`                           .M.       dMMM-     `ms.      \/d+`     `NMMs       `do\n            .yy-                             :N`    ```mMMM.      -      -hy.       \/MMM:       yh\n          `+d+`           `:\/oo\/`       `-\/osyh\/ossssssdNMM`           .sh:         yMMN`      \/m.\n         -dh-           :ymNMMMMy  `-\/shmNm-`:N\/-.``   `.sN            \/N-         `NMMy      .m\/\n       `oNs`          -hysosmMMMMydmNmds+-.:ohm           :             sd`        :MMM\/      yy\n      .hN+           \/d:    -MMMmhs\/-.`   .MMMh   .ss+-                 `yy`       sMMN`     :N.\n     :mN\/           `N\/     `o\/-`         :MMMo   +MMMN-         .`      `ds       mMMh      do\n    \/NN\/            `N+....--:\/+oooosooo+:sMMM:   hMMMM:        `my       .m+     -MMM+     :N.\n   \/NMo              -+ooooo+\/:-....`...:+hNMN.  `NMMMd`        .MM\/       -m:    oMMN.     hs\n  -NMd`                                    :mm   -MMMm- .s\/     -MMm.       \/m-   mMMd     -N.\n `mMM\/                                      .-   \/MMh. -dMo     -MMMy        od. .MMMs..---yh\n +MMM.                                           sNo`.sNMM+     :MMMM\/        sh`+MMMNmNm+++-\n mMMM-                                           \/--ohmMMM+     :MMMMm.       `hyymmmdddo\n MMMMh.                  ````                  `-+yy\/`yMMM\/     :MMMMMy       -sm:.``..-:-.`\n dMMMMmo-.``````..-:\/osyhddddho.           `+shdh+.   hMMM:     :MmMMMM\/   .\/yy\/` `:sys+\/+sh\/\n .dMMMMMMmdddddmmNMMMNNNNNMMMMMs           sNdo-      dMMM-  `-\/yd\/MMMMm-:sy+.   :hs-      \/N`\n  `\/ymNNNNNNNmmdys+\/::----\/dMMm:          +m-         mMMM+ohmo\/.` sMMMMdo-    .om:       `sh\n     `.-----+\/.`       `.-+hh\/`         `od.          NMMNmds\/     `mmy:`     +mMy      `:yy.\n           \/moyso+\/\/+ossso:.           .yy`          `dy+:`         ..       :MMMN+---\/oys:\n         \/+m:  `.-:::-`               \/d+                                    +MMMMMMMNh:`\n        +MN\/                        -yh.                                     `+hddhy+.\n       \/MM+                       .sh:\n      :NMo                      -sh\/\n     -NMs                    `\/yy:\n    .NMy                  `:sh+.\n   `mMm`               .\/yds-\n  `dMMMmyo:-.````.-:oymNy:`\n  +NMMMMMMMMMMMMMMMMms:`\n    -+shmNMMMNmdy+:`\n\n\n                                                                 Now attempting installation...\n\n\nLooking for a previous installation of SDKMAN...\nLooking for unzip...\nLooking for zip...\nLooking for curl...\nLooking for sed...\nInstalling SDKMAN scripts...\nCreate distribution directories...\nGetting available candidates...\nPrime the config file...\nDownload script archive...\n######################################################################## 100.0%\nExtract script archive...\nInstall scripts...\nSet version to 5.7.4+362 ...\nAttempt update of interactive bash profile on regular UNIX...\nAdded sdkman init snippet to \/c\/Users\/gary.fu\/.bashrc\nAttempt update of zsh profile...\nUpdated existing \/c\/Users\/gary.fu\/.zshrc\n\n\n\nAll done!\n\n\nPlease open a new terminal, or run the following in the existing one:\n\n    source \"\/c\/Users\/gary.fu\/.sdkman\/bin\/sdkman-init.sh\"\n\nThen issue the following command:\n\n    sdk help\n\nEnjoy!!!\n<\/code><\/pre>\n<p>\u73b0\u5728\u91cd\u65b0\u6253\u5f00\u4e00\u4e2aGit Bash\u6216\u8005\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u5c31\u53ef\u4ee5\u628asdkman\u52a0\u5165\u5230PATH\u4e2d\uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u4f7f\u7528sdk\u547d\u4ee4\u4e86<\/p>\n<pre><code class=\"language-bash line-numbers\">source \"$HOME\/.sdkman\/bin\/sdkman-init.sh\"\n<\/code><\/pre>\n<p>\u4f7f\u7528sdk version\u53ef\u4ee5\u67e5\u770b\u5230sdk\u7684\u7248\u672c\u4e86<\/p>\n<pre><code class=\"language-bash line-numbers\">sdk version\n<\/code><\/pre>\n<p><div class='fancybox-wrapper' data-fancybox='post-images' href='https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324165628.png'><img src=\"https:\/\/git.mengqingpo.com:8888\/fugary\/blogpic1\/-\/raw\/master\/images\/20200324165628.png\" alt=\"\" \/><\/div><\/p>\n<h2>SDKMAN\u57fa\u672c\u4f7f\u7528<\/h2>\n<p>\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\u5c31\u53ef\u4ee5\u4f7f\u7528sdk\u547d\u4ee4\uff0c\u5b89\u88c5\u548c\u914d\u7f6esdk\u4e86\u3002<\/p>\n<p>\u67e5\u770b\u5e2e\u52a9\uff1a<\/p>\n<pre><code class=\"language-bash line-numbers\">$ sdk help\n\nUsage: sdk &lt;command&gt; [candidate] [version]\n       sdk offline &lt;enable|disable&gt;\n\n   commands:\n       install   or i    &lt;candidate&gt; [version] [local-path]\n       uninstall or rm   &lt;candidate&gt; &lt;version&gt;\n       list      or ls   [candidate]\n       use       or u    &lt;candidate&gt; &lt;version&gt;\n       default   or d    &lt;candidate&gt; [version]\n       current   or c    [candidate]\n       upgrade   or ug   [candidate]\n       version   or v\n       broadcast or b\n       help      or h\n       offline           [enable|disable]\n       selfupdate        [force]\n       update\n       flush             &lt;broadcast|archives|temp&gt;\n\n   candidate  :  the SDK to install: groovy, scala, grails, gradle, kotlin, etc.\n                 use list command for comprehensive list of candidates\n                 eg: $ sdk list\n   version    :  where optional, defaults to latest stable if not provided\n                 eg: $ sdk install groovy\n   local-path :  optional path to an existing local installation\n<\/code><\/pre>\n<p>\u4f7f\u7528sdk\u5b89\u88c5maven<\/p>\n<pre><code class=\"language-bash line-numbers\">$ sdk ls maven\n================================================================================\nAvailable Maven Versions\n================================================================================\n   * 3.6.3\n     3.6.2\n     3.6.1\n     3.6.0\n     3.5.4\n     3.5.3\n     3.5.2\n     3.5.0\n     3.3.9\n================================================================================\n+ - local version\n* - installed\n&gt; - currently in use\n================================================================================\n<\/code><\/pre>\n<pre><code class=\"language-shell line-numbers\">$ sdk install maven 3.6.3\nDownloading: maven 3.6.3\nIn progress...\n######################################################################## 100.0%\nInstalling: maven 3.6.3\nDone installing!\nSetting maven 3.6.3 as default.\n<\/code><\/pre>\n<pre><code class=\"language-bash line-numbers\">$ mvn -v\nApache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)\nMaven home: C:\\Users\\gary.fu\\.sdkman\\candidates\\maven\\current\nJava version: 11.0.3, vendor: Amazon.com Inc., runtime: C:\\softs\\Java\\jdk11.0.3_7\nDefault locale: zh_CN, platform encoding: GBK\nOS name: \"windows 7\", version: \"6.1\", arch: \"amd64\", family: \"windows\"\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SDKMAN\uff08\u8f6f\u4ef6\u5f00\u53d1\u5305\u7ba1\u7406\u5668\uff09\u53ef\u4ee5\u5bf9\u5404\u79cd\u5404\u6837\u7684\u4e8c\u8fdb\u5236SDK\u5305\u8fdb\u884c\u7248\u672c\u7ba1\u7406\uff0c\u5305\u62ecGroovy\u548cJDK\u7b49\u3002 \u76ee\u524d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/posts\/29"}],"collection":[{"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fugary.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":1,"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":30,"href":"https:\/\/fugary.com\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions\/30"}],"wp:attachment":[{"href":"https:\/\/fugary.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fugary.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fugary.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}