Last active
February 21, 2026 01:14
-
-
Save cezarmezzalira/b47846dd80351bfc331545dd7f1d0cda to your computer and use it in GitHub Desktop.
Configuração do JDK 25 com JBang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.2%2B10/OpenJDK25U-jdk_x64_windows_hotspot_25.0.2_10.msi -OutFile "$env:USERPROFILE\Downloads\OpenJDK25.msi" | |
| msiexec /i "$env:USERPROFILE\Downloads\OpenJDK25.msi" INSTALLLEVEL=1 /quiet | |
| wget https://github.com/jbangdev/jbang/releases/download/v0.137.0/jbang-0.137.0.zip -OutFile "$env:USERPROFILE\Downloads\jbang.zip" | |
| # 1. Defina os caminhos (ajuste conforme sua necessidade) | |
| $zipFile = "$env:USERPROFILE\Downloads\jbang.zip" | |
| $destRoot = "$env:USERPROFILE\.jbang" | |
| # 2. Extrai o arquivo zip | |
| Expand-Archive -Path $zipFile -DestinationPath $destRoot -Force | |
| # 3. Localiza a subpasta criada (assumindo que só existe uma pasta principal lá dentro) | |
| $subFolder = Get-ChildItem -Path $destRoot | Where-Object { $_.PSIsContainer } | Select-Object -First 1 | |
| if ($subFolder) { | |
| # 4. Move o conteúdo da subpasta para o diretório pai | |
| Get-ChildItem -Path $subFolder.FullName | Move-Item -Destination $destRoot -Force | |
| # 5. Remove a subpasta agora vazia | |
| Remove-Item -Path $subFolder.FullName -Recurse -Force | |
| Write-Host "Arquivos movidos com sucesso para a raiz!" -ForegroundColor Green | |
| } else { | |
| Write-Host "Nenhuma subpasta encontrada." -ForegroundColor Yellow | |
| } | |
| $oldPath = [Environment]::GetEnvironmentVariable("PATH", "User") | |
| $newPath = "$oldPath$env:USERPROFILE\.jbang\bin;" | |
| [Environment]::SetEnvironmentVariable("PATH", $newPath, "User") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment