-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
scoop reset does not switch java version #3822
Comments
Does restarting console solve this problem? |
No, it does not. I forgot to mention it. |
me too, |
I think the problem is, that My current workaround is to execute Also, you need to add Note: If you installed scoop in a different directory, than the default, you'd need to use the |
I believe this is because This will probably be solved if both openjdk packages will list |
@Smail Yes, this is exactly the reason you wrote.
The documentation about switching Java versions is misleading because it says the opposite as it should work as intended 🤷♂️. |
+1 from my side, just got confused by the documentation There is a corretto, a corretto8 and a corretto11 package. To make it work with reset we would need both version in one package, right? |
I use corretto, sapmachine and openjdk and would like to switch from one to another using scoop reset Vendor@version. |
Pretty cool solution. I think it should be integrated into Scoop core. Define "platforms", like The benefit of solution - it is only few IO calls to FS, no need to restart apps to pick up updated Command for managing platforms might emit helpers for CMD/WSL/Cygwin for other env vars (like
|
I think that |
Seems to be fixed now. |
> scoop list zulu
Installed apps matching 'zulu':
zulu11-jdk 11.54.23 [java]
zulu17-jdk 17.32.13 [java]
> scoop which java
C:\Users\HUMOR\scoop\apps\zulu11-jdk\current\bin\java.exe
> java --version
openjdk 11.0.14 2022-01-18 LTS
OpenJDK Runtime Environment Zulu11.54+23-CA (build 11.0.14+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.54+23-CA (build 11.0.14+9-LTS, mixed mode)
> scoop reset zulu17-jdk
Resetting zulu17-jdk (17.32.13).
Linking ~\scoop\apps\zulu17-jdk\current => ~\scoop\apps\zulu17-jdk\17.32.13
> scoop which java
C:\Users\HUMOR\scoop\apps\zulu17-jdk\current\bin\java.exe
> java --version
openjdk 17.0.2 2022-01-18 LTS
OpenJDK Runtime Environment Zulu17.32+13-CA (build 17.0.2+8-LTS)
OpenJDK 64-Bit Server VM Zulu17.32+13-CA (build 17.0.2+8-LTS, mixed mode, sharing) |
I have Java 17 (Microsoft) installed on System (installed automatically by VSCode. For reason I need Java RE 8 (Oracle), I get this installed via Scoop. Now I can't switch to System and the current At the moment, I have to delete the user's variable |
Which extension did this? |
@HUMORCE it was the one on VSCode docs web site. The Java section. |
this is not a mandatory option. for switching java between other installation(s and scoop installation(s, you need to write a script yourself. |
I see. |
Sorry, but I am confused about the current state of this issue - when I follow the Java Switching example on the Java wiki I don't get the same results as are documented -- it basically doesn't work for me. I am a scoop beginner and maybe don't understand all aspects but at least I would wish for a documentation that describes a working solution and also a clear statement what JDKs are switchable and which are not - the wiki says "currently this isn't working for all available packages" but doesn't go into more detail. PS loving scoop so far!! easy java switching would be supercool |
scoop-reset switches apps by overriding shims, environment variables, etc. or change PATH order, which means it can siwtch apps installed by Scoop. Example: 1 JDK are external, and 2 JDKs are Scooped.
|
Okay, I identified whats going on. Resetting the JDK version does only work within a Powershell (installing a new JDK and auto-switchting to it). Apologies if this is documented somewhere but maybe its a bug? Anyways if possible a warning should be displayed when trying to switch from a non-powershell terminal. |
For Command Prompt(cmd.exe), it works on future sessions. Lines 945 to 955 in f930280
|
I followed the guide for switching java versions but it somehow seems to not work in my case.
I have both
openjdk11
andopenjdk13
installed from thejava
bucket:The current
java
isopenjdk11
in my caseNow I want to switch to
openjdk13
by usingscoop reset
command (as mentioned in the guide)The command ends with success. However, the
java
version is not switched. It is still locked atopenjdk11
:A quick investigation revealed two
java
executables on the%PATH%
$ where java
So the shell will always take the first one available,
openjdk11
in my case.Is the the
scoop reset
command broken ATM? Or, maybe I misunderstood thescoop reset
command?My
scoop
version isThe text was updated successfully, but these errors were encountered: