TL;DR
When using Git Bash (MINGW64) or MSYS2 that comes with Git for Windows, use SDKMAN! By adding the following to .bashrc
etc. Will be possible.
.bashrc
export MSYS=winsymlinks:lnk
The installation itself is as follows, so it is omitted.
https://sdkman.io/install
The JDK is being built and provided by various vendors and communities, so I'd like to make it easy to switch. (Do you think?)
If you want to do the above, you will need a version management tool such as the JDK. There is a tool called SDKMAN! In the JVM system, so use this.
Please refer to the following for the SDK that can be installed using SDKMAN! (Indicated because it is written. Various languages, tools, application frameworks, etc. can be installed).
Looking at the following, it seems that it can be used normally with Git Bash, but although I can download the JDK, I get an error when I try to set it to the default.
https://sdkman.io/install
$ sdk default java 8.0.202.hs-adpt
SDKMAN: No update needed. Using existing candidates cache: ant,asciidoctorj,bpipe,ceylon,crash,cuba,cxf,gaiden,glide,gradle,grails,groovy,groovyserv,infrastructor,java,jbake,kotlin,kscript,lazybones,leiningen,maven,micronaut,sbt,scala,spark,springboot,sshoogr,vertx,visualvm
Not refreshing version cache now...
Validate java 8.0.202.hs-adpt for MINGW64_NT-10.0: valid
Validation URL: https://api.sdkman.io/2/candidates/validate/java/8.0.202.hs-adpt/mingw64_nt-10.0
rm: cannot remove '/c/Users/tenten0213/.sdkman/candidates/java/current': Is a directory
ln: failed to create symbolic link '/c/Users/tenten0213/.sdkman/candidates/java/current/8.0.202.hs-adpt': File exists
↑ enables debug mode. (Set sdkman_debug_mode
in ~ / .sdkman / etc / config
to true
)
Looking at the code, it seems that there is an error in the following rm -f
.
https://github.com/sdkman/sdkman-cli/blob/b63ee15c8885b89ea09dee4f965fbd48167398d1/src/main/bash/sdkman-path-helpers.sh#L85
The reason for the error is that if you don't set it at the beginning, ln -s
will not create a symbolic link, it will create a copy. It's a directory instead of a symbolic link, so rm -f
will result in an error.
So, by returning to the beginning and setting MSYS = winsymlinks: lnk
, symbolic links (Windows shortcuts) are created instead of copies, and they can be used safely.
Recommended Posts