Installed Temurin JDK 17 is matched to EclipseAdoptium.Temurin.21.JDK instead of EclipseAdoptium.Temurin.17.JDK

Abierto
#6,700 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp
Área
cli

Línea de trabajo

Start with the installed-package correlation log lines: the ARP product and upgrade codes for the JDK 17 install match the manifest at manifests/e/EclipseAdoptium/Temurin/17/JDK/17.0.21.9/EclipseAdoptium.Temurin.17.JDK.installer.yaml, yet multiple strong matches are reported. Check whether any EclipseAdoptium.Temurin.21.JDK manifest carries the JDK 17 codes, since that would make this a winget-pkgs data issue. Done means winget list --name Temurin reports JDK 17 under EclipseAdoptium.Temurin.17.JDK and no JDK 21 upgrade is offered for it.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Command-Install Command-List Command-Upgrade Issue-Bug Needs-Triage
Relevant area(s)

WinGet CLI

Relevant command(s)

winget list, winget install, winget upgrade

Brief description of your issue

When several Eclipse Temurin JDKs are installed side by side, winget list matches the installed Temurin JDK 17 to the wrong package: EclipseAdoptium.Temurin.21.JDK instead of EclipseAdoptium.Temurin.17.JDK.

It was installed with winget install EclipseAdoptium.Temurin.17.JDK. Its ARP product code and upgrade code match the EclipseAdoptium.Temurin.17.JDK 17.0.21.9 manifest exactly. Because of the wrong match, winget (and front ends such as UniGetUI) offer a JDK 21 installer as an "upgrade" for JDK 17.

Steps to reproduce
  1. Install several Temurin JDKs side by side, for example:
    • winget install EclipseAdoptium.Temurin.8.JDK
    • winget install EclipseAdoptium.Temurin.17.JDK
    • winget install EclipseAdoptium.Temurin.21.JDK
    • winget install EclipseAdoptium.Temurin.25.JDK
  2. Run winget list --name Temurin.
Expected behavior

winget list shows the installed "Eclipse Temurin JDK with Hotspot 17.0.21+9 (x64)" under EclipseAdoptium.Temurin.17.JDK, because its product code and upgrade code match that package's manifest exactly. winget upgrade therefore does not offer the JDK 21 installer as an upgrade for it.

Actual behavior

winget list --name Temurin shows JDK 17 under the Temurin 21 package ID:

Name                                               Id                             Version
-----------------------------------------------------------------------------------------------
Eclipse Temurin JDK with Hotspot 17.0.21+9 (x64)   EclipseAdoptium.Temurin.21.JDK 17.0.21.9
Eclipse Temurin JDK with Hotspot 21.0.13.1+2 (x64) EclipseAdoptium.Temurin.21.JDK 21.0.13.10002
Eclipse Temurin JDK with Hotspot 25.0.5.1+2 (x64)  EclipseAdoptium.Temurin.25.JDK 25.0.5.10002
Eclipse Temurin JDK with Hotspot 8u512-b09 (x64)   EclipseAdoptium.Temurin.8.JDK  8.0.512.9

The installed JDK 17 has these codes:

  • Product code: {FBF4C8AA-8099-4F4C-BD10-CCD06B0B01D3}
  • Upgrade code: {3385E798-4714-23E5-45F0-9C71471240FA}

Both appear in manifests/e/EclipseAdoptium/Temurin/17/JDK/17.0.21.9/EclipseAdoptium.Temurin.17.JDK.installer.yaml.

The winget log shows that correlation finds more than one strong match:

[REPO] Found multiple matches for installed package [ARP\Machine\X64\{FBF4C8AA-8099-4F4C-BD10-CCD06B0B01D3}] in source [Microsoft.Winget.Source_8wekyb3d8bbwe] when searching for [Query:[none] Include:ProductCode='{fbf4c8aa-8099-4f4c-bd10-ccd06b0b01d3}'[Exact] Include:UpgradeCode='{3385e798-4714-23e5-45f0-9c71471240fa}'[Exact] Include:NormalizedNameAndPublisher='eclipsetemurinjdkwithhotspot9'+'eclipseadoptium'[Exact] Include:NormalizedNameAndPublisher='eclipsetemurinjdkwithhotspot9(x64)'+'eclipseadoptium'[Exact]]
[REPO]   Found multiple packages with strong match fields

Note the normalized name. "Eclipse Temurin JDK with Hotspot 17.0.21+9 (x64)" becomes eclipsetemurinjdkwithhotspot9, the same value that "Eclipse Temurin JDK with Hotspot 21.0.13+9 (x64)" produces. The version is only partly stripped, leaving the build number 9. As a result, the name and publisher no longer tell the Temurin major versions apart.

Even so, I'd expect an exact ProductCode or UpgradeCode match to win over a normalized name match. If it doesn't, one of the EclipseAdoptium.Temurin.21.JDK manifests may contain the JDK 17 codes, which would make this a winget-pkgs data issue instead.

After removing JDK 21, winget install EclipseAdoptium.Temurin.21.JDK also reports "Found installed package, converting to upgrade flow", because it treats the installed JDK 17 as the Temurin 21 package.

Environment
Windows Package Manager v1.29.380
Windows: Windows.Desktop v10.0.26200.9911
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.29.380.0

WinGet Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads
Configuration Modules              %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
ConfigurationProcessorPath                Disabled
DefaultProxy                              Disabled
Lenguaje dominante
C++
Estrellas
26.6k
Forks
1.8k
Merge medio
2 d 18 h
PR fusionados (30 d)
42

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/winget-cli

Todos los issues de microsoft/winget-cli

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.