Scoop version switching¶
Scoop version switching is a mechanism in the Scoop package manager for Windows that allows users to alternate between different installed versions of a specific software package. This feature is particularly useful for managing development environments, such as Java Development Kits (JDKs), where projects may require different runtime versions.^[400-devops__02-OS-and-Linux-Basics__windows__scoop.md]
Switching mechanism¶
Scoop uses the scoop reset <app> command to handle version switching. When executed, this command updates the symbolic link for the application's current directory to point to the desired version.^[400-devops__02-OS-and-Linux-Basics__windows__scoop.md] For example, after installing both openjdk17 and openjdk11, a user can switch the active Java environment by running the reset command.^[400-devops__02-OS-and-Linux-Basics__windows__scoop.md]
Practical Example¶
The typical workflow involves installing multiple versions of a package and then switching between them as needed.^[400-devops__02-OS-and-Linux-Basics__windows__scoop.md]
- Install versions: Use
scoop install <app><version>to install the desired targets. - Reset version: Use
scoop reset <app><version>to make it active.
For instance, after installing openjdk17, installing openjdk11, and then running scoop reset openjdk11, the system updates the link structure so that java -version reports OpenJDK 11.^[400-devops__02-OS-and-Linux-Basics__windows__scoop.md]
Sources¶
^[400-devops__02-OS-and-Linux-Basics__windows__scoop.md]