-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jbang jdk default <version> fails on Windows #1793
Comments
Unfortunately I don't think there's an easy way to create junctions with Java, which is what we'd need. Edit: btw, on Windows we shouldn't even try to create a Hard Link. |
Not sure about the Java version, will check later. When debugging it's perhaps the vscode embedded (21). Otherwise 17 or 21 As fat as edit3, I was running the latest commit on main last night after running 0.116 from scoop Looking at the screenshot of my debugging session closely shows you why it got there - As far creating a junction in Java, how about calling powershell? It's built into Windows |
@quintesse for the junction question - to avoid Developer Mode in a place where it isn't permitted - what are your thoughts on just calling powershell or cmd.exe as an external process on Windows? would like to be able to use this in a secured corporate environment if not, maybe I'll just fork it privately inside the secure environment and maintain the forked version |
* feat: we can now create junctions on Windows Fixes #1793 * chore: made variable names clearer * fix: fixed setting default JDK on Windows On Windows it was possible to leave a JDK in a broken state by changing the default JDK * chore: remove Dev Mode check from jbang script Checking for Developer Mode when it's only necessary for the `edit` command will only bother users, best to only give the warning when actually needed * docs: refined special Windows setup instructions
Describe the bug
Follow-up to #1574 by @quintesse
This is when using "Git Bash" - and particularly the msys bash inside of it.
This is what I see:
To Reproduce
I'm running bash on Windows 10.
uname -a
reportsMSYS_NT-10.0-19045 t480-ben 3.4.7-25de8b84.x86_64 2023-08-28 21:32 UTC x86_64 Msys
I reproduced this in Powershell IIRC but my main way of working in Windows is inside cygwin / msys.
I execute via the Windows Terminal - I configure a profile like this after installing Git via
winget install Git.Git
. I'm using/Git/usr/bin/bash.exe
which has the cygwin dll included, but not sure that matters.Expected behavior
jbang jdk default 21 should succeed
JBang version
Additional context
I don't think requiring Developer Mode is good - many people developing in Windows are doing it for security reasons and it's hard convince a security department to enable Developer Mode.
As noted earlier in the linked issue, you can't hard link to directories. But there's another option - use junctions instead. fnm did that recently Schniz/fnm#519 - see also kubernetes-sigs/krew#843
An example of creating a junction from my initial dotfiles setup script:
powershell.exe New-Item -ItemType Junction -Force -Path $(cygpath -m "$HOME/scoop/persist/vscode/data/user-data/User") -Target $(cygpath -m "$SCRIPT_DIR"/config/vscode/User)
The text was updated successfully, but these errors were encountered: