Notices: This section not yet converted to new layout. Download stats are rolling back out.

Java SE Runtime Environment

8.0.221

Package test results are passing.

Private CDN cached downloads available for licensed customers. Never experience 404 breakages again! Learn more...

This package was approved as a trusted package on 7/19/2019.

Java allows you to play online games, chat with people around the world, calculate your mortgage interest, and view images in 3D, just to name a few. It's also integral to the intranet applications and other e-business solutions that are the foundation of corporate computing. Please note you now need a Java License from Oracle to use unless installed for Personal Use and Development Use.

Note

This package installs the Java version offered at https://www.java.com. It also sets SPONSORS=0 (see docs).

If you wish to only install the 32-bit version of Java use the /exclude parameter. The switch to exclude 32-bit is /exclude:32 and to exclude 64-bit /exclude:64
For example: choco install jre8 -PackageParameters "/exclude:64" -y
This package no longer manually adds an environment variable.
x86 installs of Windows you can expect to see an error while reading the registry, but the script will still function normally.

This package can install 32-bit, 64-bit, or both versions. Find on GitHub

To install Java SE Runtime Environment, run the following command from the command line or from PowerShell:

C:\> choco install jre8

To upgrade Java SE Runtime Environment, run the following command from the command line or from PowerShell:

C:\> choco upgrade jre8

Files

Hide
  • tools\chocolateyInstall.ps1 Show
    try {
    
    $arguments = @{}
    
      # Now we can use the $env:chocolateyPackageParameters inside the Chocolatey package
      $packageParameters = $env:chocolateyPackageParameters
    
      # Default value
      $exclude = $null
    
      # Now parse the packageParameters using good old regular expression
      if ($packageParameters) {
          $match_pattern = "\/(?<option>([a-zA-Z0-9]+)):(?<value>([`"'])?([a-zA-Z0-9- \(\)\s_\\:\.]+)([`"'])?)|\/(?<option>([a-zA-Z]+))"
          $option_name = 'option'
          $value_name = 'value'
    
          if ($packageParameters -match $match_pattern ){
              $results = $packageParameters | Select-String $match_pattern -AllMatches
              $results.matches | % {
                $arguments.Add(
                    $_.Groups[$option_name].Value.Trim(),
                    $_.Groups[$value_name].Value.Trim())
            }
          }
          else
          {
              Throw "Package Parameters were found but were invalid (REGEX Failure)"
          }
    
          if($arguments.ContainsKey("exclude")) {
              Write-Host "exclude Argument Found"
              $exclude = $arguments["exclude"]
          }
    
      } else {
          Write-Debug "No Package Parameters Passed in"
      }
    
      $scriptDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
      
      $packageName = 'jre8'
      # Modify these values -----------------------------------------------------
      # Find download URLs at http://www.java.com/en/download/manual.jsp
      $url = 'https://javadl.oracle.com/webapps/download/AutoDL?BundleId=239856_230deb18db3e4014bb8e3e8324f81b43'
      $checksum32 = '42D7AE998D701FD6AB9D8BDF8DF4A13915A4FB8429578C5A6C5A216E3873B63B'
      $url64 = 'https://javadl.oracle.com/webapps/download/AutoDL?BundleId=239858_230deb18db3e4014bb8e3e8324f81b43'
      $checksum64 = '61CCC93957A931D63535E6785FE814E3AB9EFDC7C5B6757E7CC0E5B27A89704C'
      $oldVersion = '8.0.2110.12'
      $version = '8.0.2210.11'
      #--------------------------------------------------------------------------
      $homepath = $version -replace "(\d+\.\d+)\.(\d\d)(.*)",'jre1.$1_$2'
      $installerType = 'exe'
      $installArgs = "/s REBOOT=0 SPONSORS=0 AUTO_UPDATE=0 $32dir"
      $installArgs64 = "/s REBOOT=0 SPONSORS=0 AUTO_UPDATE=0 $64dir"
      $osBitness = Get-ProcessorBits
      $cachepath = "$env:temp\$packagename\$version"
      Write-Host "The software license has changed for Java and this software must be licensed for general business use. Please ensure your licensing is compliant before installing." -ForegroundColor white -BackgroundColor red
      #This checks to see if current version is already installed
      Write-Output "Checking to see if local install is already up to date..."
      try{
      $checkreg64 = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion | Where-Object { $_.DisplayName -like '*Java 8*' -and ([Version]$_.DisplayVersion) -eq $version} -ErrorAction SilentlyContinue
      $checkreg32 = Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion | Where-Object { $_.DisplayName -like '*Java 8*' -and ([Version]$_.DisplayVersion) -eq $version} -ErrorAction SilentlyContinue
      }catch{
      Write-Output "Registry check failed. This is commonly caused by corrupt keys (Do you have netbeans installed?)"
      }
    
        # Checks if JRE 32/64-bit in the same version is already installed and if the user excluded 32-bit Java.
        # Otherwise it downloads and installs it.
        # This is to avoid unnecessary downloads and 1603 errors.
        if ($checkreg32 -ne $null) 
        {
          Write-Output "Java Runtime Environment $version (32-bit) is already installed. Skipping download and installation"
        } 
        elseif ($exclude -ne "32") 
        {
          Write-Output "Downloading 32-bit installer"
          Get-ChocolateyWebFile -packageName $packageName -fileFullPath "$cachepath\JRE8x86.exe" -url $url -checksum $checksum32 -checksumType 'SHA256'
          Write-Output "Installing JRE $version 32-bit"
          Install-ChocolateyInstallPackage -packageName JRE8 -fileType $installerType -silentArgs $installArgs -file "$cachepath\JRE8x86.exe"
          #Install-ChocolateyPackage $packageName $installerType $installArgs -url "$env:temp\chocolatey\$packagename\$version\JRE8x86.exe" -checksum $checksum32 -checksumtype 'sha256'
        } 
        else 
        {
          Write-Output "Java Runtime Environment $Version (32-bit) excluded for installation"
        }
    
        # Only check for the 64-bit version if the system is 64-bit
    
        if ($osBitness -eq 64) 
        {
          if ($checkreg64 -ne $null) 
          {
            Write-Output "Java Runtime Environment $version (64-bit) is already installed. Skipping download and installation"
          } 
          elseif ($exclude -ne "64") 
          {
            Write-Output "Downloading 64-bit installer"
            Get-ChocolateyWebFile -packageName $packageName -fileFullPath "$cachepath\JRE8x64.exe" -url64 $url64 -checksum64 $checksum64 -checksumType 'SHA256'
            Write-Output "Installing JRE $version 64-bit"
            Install-ChocolateyInstallPackage -packageName JRE8 -fileType $installerType -silentArgs $installArgs -file64 "$cachepath\JRE8x64.exe"
    
           # Install-ChocolateyPackage $packageName $installerType $installArgs64 -url64bit "$env:temp\chocolatey\$packagename\$version\JRE8x64.exe" -checksum64 $checksum64 -checksumtype64 'sha256'
          } 
          else 
          {
            Write-Output "Java Runtime Environment $Version (64-bit) excluded for installation"
          }
        }
      
      #Uninstalls the previous version of Java if either version exists
      Write-Output "Searching if the previous version exists..."
      $checkoldreg64 = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, PSChildName | Where-Object { $_.DisplayName -like '*Java 8*' -and ([Version]$_.DisplayVersion) -eq $oldversion} -ErrorAction SilentlyContinue
      $checkoldreg32 = Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, PSChildName | Where-Object { $_.DisplayName -like '*Java 8*' -and ([Version]$_.DisplayVersion) -eq $oldversion} -ErrorAction SilentlyContinue
     
      if($checkoldreg32 -ne $null) 
      {
         Write-Warning "Uninstalling JRE version $oldVersion 32bit"
         $32 = $checkoldreg32.PSChildName
         Start-ChocolateyProcessAsAdmin "/qn /norestart /X$32" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010)
      }
      if($checkoldreg64 -ne $null)
      {
         Write-Warning "Uninstalling JRE version $oldVersion $osBitness bit" #Formatted weird because this is used if run on a x86 install
         $64 = $checkoldreg64.PSChildName
         Start-ChocolateyProcessAsAdmin "/qn /norestart /X$64" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010)
      }
    } catch {
      #Write-ChocolateyFailure $packageName $($_.Exception.Message)
      throw
    }
    
  • tools\chocolateyUninstall.ps1 Show
    Write-Debug ("Starting " + $MyInvocation.MyCommand.Definition)
    
    $scriptDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
    
    
    [string]$packageName="JRE8"
    $version = '8.0.2210.11'
    #$thisJreInstalledHash = thisJreInstalled($version)
      $checkreg64 = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, PSChildName | Where-Object { $_.DisplayName -like '*Java 8*' -and ([Version]$_.DisplayVersion) -eq $version} -ErrorAction SilentlyContinue
      $checkreg32 = Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, PSChildName | Where-Object { $_.DisplayName -like '*Java 8*' -and ([Version]$_.DisplayVersion) -eq $version} -ErrorAction SilentlyContinue
      $osBitness = Get-ProcessorBits
    <#
    Exit Codes:
        0: Java installed successfully.
        1605: Java is not installed.
        3010: A reboot is required to finish the install.
    #>
    
    if($checkreg32 -ne $null) 
      {
         Write-Warning "Uninstalling JRE version $Version 32bit"
         $32 = $checkreg32.PSChildName
         Start-ChocolateyProcessAsAdmin "/qn /norestart /X$32" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010)
      }
      if($checkreg64 -ne $null)
      {
         Write-Warning "Uninstalling JRE version $Version $osBitness bit" #Formatted weird for x86 windows installs
         $64 = $checkreg64.PSChildName
         Start-ChocolateyProcessAsAdmin "/qn /norestart /X$64" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010)
      }
    
    Write-Warning "$packageName may require a reboot to complete the uninstallation."
    

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

This package has no dependencies.

Package Maintainer(s)

Software Author(s)

  • Oracle

Tags

Version History

Version Downloads Last updated Status
Java SE Runtime Environment 8.0.211 990640 Thursday, April 25, 2019 approved
Java SE Runtime Environment 8.0.201 1164940 Wednesday, January 23, 2019 approved
Java SE Runtime Environment 8.0.191.20181114 722697 Wednesday, November 14, 2018 approved
Java SE Runtime Environment 8.0.191 162193 Saturday, November 10, 2018 approved
Java SE Runtime Environment 8.0.181 1094740 Wednesday, July 25, 2018 approved
Java SE Runtime Environment 8.0.171 687865 Monday, April 30, 2018 approved
Java SE Runtime Environment 8.0.161 1283593 Tuesday, January 23, 2018 approved
Java SE Runtime Environment 8.0.151 852460 Friday, October 27, 2017 approved
Java SE Runtime Environment 8.0.144 659181 Friday, August 11, 2017 approved
Show More

Discussion for the Java SE Runtime Environment Package

Ground rules:

  • This discussion is only about Java SE Runtime Environment and the Java SE Runtime Environment package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Java SE Runtime Environment, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus
Chocolatey.org uses cookies to enhance the user experience of the site.
Ok