6,089,408
Downloads
528,566
Downloads of v 8.0.121
2/2/2017
Last update
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.
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.
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
--version 8.0.121
To upgrade Java SE Runtime Environment, run the following command from the command line or from PowerShell:
C:\> choco upgrade jre8
--version 8.0.121
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) # Import function to test if JRE in the same version is already installed Import-Module (Join-Path $scriptDir 'thisJreInstalled.ps1') $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=218831_e9e7ea248e2c4826b92b3f075a80e441' $checksum32 = '13D5ED94FE40D9403D5D25B1EF46593DC7F96993DF735EA36A32DB3DC8ED8EC7' $url64 = 'https://javadl.oracle.com/webapps/download/AutoDL?BundleId=218833_e9e7ea248e2c4826b92b3f075a80e441' $checksum64 = '6741ACEFEB3845964534B3821D459B95C7DFA079F104C5041D1F95D3B6B7A502' $oldVersion = '8.0.1110.14' $version = '8.0.1210.13' #-------------------------------------------------------------------------- $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 Write-Output "Searching if new version exists..." $thisJreInstalledHash = thisJreInstalled($version) # This is the code for both javaruntime and javaruntime-platformspecific packages. # If the package is javaruntime-platformspecific, only install the jre version # based on the OS bitness, otherwise install both 32- and 64-bit versions if ($packageName -match 'platformspecific') { if (($thisJreInstalledHash[0]) -or ($thisJreInstalledHash[1])) { Write-Output "Java Runtime Environment $version is already installed. Skipping download and installation to avoid 1603 errors." } else { Install-ChocolateyPackage $packageName $installerType $installArgs $url $url64 } } else { # Otherwise it is the javaruntime package which installs by default both 32- and 64-bit jre versions on 64-bit systems. # 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 ($thisJreInstalledHash[0]) { Write-Output "Java Runtime Environment $version (32-bit) is already installed. Skipping download and installation" } elseif ($exclude -ne "32") { Install-ChocolateyPackage $packageName $installerType $installArgs $url -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 ($thisJreInstalledHash[1]) { Write-Output "Java Runtime Environment $version (64-bit) is already installed. Skipping download and installation" } elseif ($exclude -ne "64") { # Here $url64 is used twice to obtain the correct message from Chocolatey # that it installed the 64-bit version, otherwise it would display 32-bit, # regardless of the actual bitness of the software. Install-ChocolateyPackage $packageName $installerType $installArgs64 $url64 $url64 -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..." $oldJreInstalledHash = thisJreInstalled($oldVersion) if($oldJreInstalledHash[0]) { Write-Warning "Uninstalling JRE version $oldVersion 32bit" $32 = $oldJreInstalledHash[0].IdentifyingNumber Start-ChocolateyProcessAsAdmin "/qn /norestart /X$32" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010) } if($oldJreInstalledHash[1]) { Write-Warning "Uninstalling JRE version $oldVersion 64bit" $64 = $oldJreInstalledHash[1].IdentifyingNumber 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) # Import function to test if JRE in the same version is already installed Import-Module (Join-Path $scriptDir 'thisJreInstalled.ps1') [string]$packageName="Javaruntime" $version = '8.0.1210.13' $thisJreInstalledHash = thisJreInstalled($version) <# Exit Codes: 0: Java installed successfully. 1605: Java is not installed. 3010: A reboot is required to finish the install. #> if($thisJreInstalledHash[0]) { Write-Warning "Uninstalling JRE version $Version 32bit" $32 = $thisJreInstalledHash[0].IdentifyingNumber Start-ChocolateyProcessAsAdmin "/qn /norestart /X$32" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010) } if($thisJreInstalledHash[1]) { Write-Warning "Uninstalling JRE version $Version 64bit" $64 = $thisJreInstalledHash[1].IdentifyingNumber Start-ChocolateyProcessAsAdmin "/qn /norestart /X$64" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010) } Write-Warning "$packageName may require a reboot to complete the uninstallation."
- tools\thisJreInstalled.ps1
Show
# This function checks if the same version of JRE is already installed on the computer. # It returns a hash map with a 'x86_32' and 'x86_64'. These values are not empty if the # same version and bitness of JRE is already installed. function thisJreInstalled($version) { $productSearch = Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -match '^Java \d+ Update \d+'} # The regexes for the name of the JRE registry entries (32- and 64 bit versions) $nameRegex32 = '^Java \d+ Update \d+$' $nameRegex64 = '^Java \d+ Update \d+ \(64-bit\)$' $versionRegex = $('^' + $version + '\d*$') $x86_32 = $productSearch | Where-Object {$_.Name -match $nameRegex32 -and $_.Version -match $versionRegex} $x86_64 = $productSearch | Where-Object {$_.Name -match $nameRegex64 -and $_.Version -match $versionRegex} if($x86_32 -eq $null) { $x86_32 = $false } if($x86_64 -eq $null) { $x86_64 = $false } return $x86_32,$x86_64 }
Virus Scan Results
- jre8.8.0.121.nupkg (1870f4591b9b) - ## / 58 - Log in or click on link to see number of positives
- jre8Install.exe (6741acefeb38) - ## / 57 - Log in or click on link to see number of positives
Dependencies
This package has no dependencies.
Package Maintainer(s)
Software Author(s)
Tags
Version History
Version | Downloads | Last updated | Status |
---|---|---|---|
Java SE Runtime Environment 8.0.161 | 1189722 | Tuesday, January 23, 2018 | approved |
Java SE Runtime Environment 8.0.151 | 815385 | Friday, October 27, 2017 | approved |
Java SE Runtime Environment 8.0.144 | 658171 | Friday, August 11, 2017 | approved |
Java SE Runtime Environment 8.0.141 | 213520 | Thursday, July 20, 2017 | approved |
Java SE Runtime Environment 8.0.131 | 652782 | Friday, April 28, 2017 | approved |
Java SE Runtime Environment 8.0.121 | 528566 | Thursday, February 2, 2017 | approved |
Java SE Runtime Environment 8.0.111 | 585319 | Saturday, November 5, 2016 | approved |
Java SE Runtime Environment 8.0.101.20160917 | 369172 | Sunday, September 18, 2016 | approved |
Java SE Runtime Environment 8.0.101 | 400525 | Friday, July 22, 2016 | approved |
Java SE Runtime Environment 8.0.91 | 33903 | Friday, April 22, 2016 | approved |
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.