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

Aberta
#6,700 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
30/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
cpp
Domínio
cli

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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
Linguagem predominante
C++
Estrelas
26.6k
Forks
1.8k
Merge médio
2d 18h
PRs com merge (30d)
42

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microsoft/winget-cli

Todas as issues de microsoft/winget-cli

Issues semelhantes

Mais issues de C++

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.