9,287,530
Downloads
308,296
Downloads of v 8.0.45
4/22/2015
Last update
Java SE Runtime Environment
8.0.45
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 install to an alternate directory, use the 32dir and/or the 64dir parameter. An example would be choco install jre8 -PackageParameters "/32dir:c:\path\to\install /64dir:c:\path\to\64" -y
This package installs both 32 and 64-bit versions on 64-bit systems.
To install Java SE Runtime Environment, run the following command from the command line or from PowerShell:
C:\> choco install jre8
--version 8.0.45
To upgrade Java SE Runtime Environment, run the following command from the command line or from PowerShell:
C:\> choco upgrade jre8
--version 8.0.45
Files
Hide- tools\chocolateyInstall.ps1
Show
try { $arguments = @{} # Now we can use the $env:chocolateyPackageParameters inside the Chocolatey package $packageParameters = $env:chocolateyPackageParameters # Default value $32dir = $null $64dir = $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("32dir")) { Write-Host "32dir Argument Found" $32dir = $arguments["32dir"] $32dir = "INSTALLDIR=`"$32dir`"" } if ($arguments.ContainsKey("64dir")) { Write-Host "64dir Argument Found" $64dir = $arguments["64dir"] $64dir = "INSTALLDIR=`"$64dir`"" } } 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') Import-Module (Join-Path $scriptDir 'uninstall-oldJre.ps1') $packageName = 'jre8' # Find download URLs at http://www.java.com/en/download/manual.jsp $url = 'http://javadl.sun.com/webapps/download/AutoDL?BundleId=106246' $url64 = 'http://javadl.sun.com/webapps/download/AutoDL?BundleId=106248' $oldVersion = '8.0.40' $version = '8.0.45' $homepath = $version -replace "(\d+\.\d+)\.(\d+)",'jre1.$1_$2' $installerType = 'exe' $installArgs = "/s REBOOT=Suppress SPONSORS=0 $32dir" $installArgs64 = "/s REBOOT=Suppress SPONSORS=0 $64dir" $osBitness = Get-ProcessorBits # If both 32- and 64-bit versions are installed, it adds only the folder # of the 64-bit version to the env variables if ($osBitness -eq 64 -and $arguments["64dir"]) { $javaHome = $arguments["64dir"] }elseif ($osBitness -eq 32 -and $arguments["32dir"]) { $javaHome = $arguments["32dir"] }else{ $javaHome = Join-Path $env:ProgramFiles "Java\$homepath" } # Create variable for environment path $jreForPathVariable = Join-Path $javaHome 'bin' $thisJreInstalledHash = thisJreInstalled($version) $oldJreInstalledHash = thisJreInstalled($oldVersion) # 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.x86_32 -or $thisJreInstalledHash.x86_64) { 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 both 32- and 64-bit jre versions on 64-bit systems # Checks if JRE 32/64-bit in the same version is already installed, # otherwise it downloads and installs it. # This is to avoid unnecessary downloads and 1603 errors. if ($thisJreInstalledHash.x86_32) { Write-Output "Java Runtime Environment $version (32-bit) is already installed. Skipping download and installation" } else { Install-ChocolateyPackage $packageName $installerType $installArgs $url } # Only check for the 64-bit version if the system is 64-bit if ($osBitness -eq 64) { if ($thisJreInstalledHash.x86_64) { Write-Output "Java Runtime Environment $version (64-bit) is already installed. Skipping download and installation" } else { # 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 } } } #Uninstalls the previous version of Java if either version exists if(($oldJreInstalledHash.x86_32) -or ($oldJreInstalledHash.x86_64)){ uninstall-oldJre($oldVersion) } # Only set the entry for the PATH variable and the JAVA_HOME env variable # if the same version of JRE was not already installed (32- or 64-bit separately) if (!($thisJreInstalledHash.x86_32) -or !($thisJreInstalledHash.x86_64)) { Install-ChocolateyPath $jreForPathVariable 'Machine' Start-ChocolateyProcessAsAdmin @" [Environment]::SetEnvironmentVariable('JAVA_HOME', '$javaHome', 'Machine') "@ } } catch { #Write-ChocolateyFailure $packageName $($_.Exception.Message) throw }
- tools\chocolateyUninstall.ps1
Show
Write-Debug ("Starting " + $MyInvocation.MyCommand.Definition) [string]$packageName="Javaruntime" <# Exit Codes: 0: Java installed successfully. 1605: Java is not installed. 3010: A reboot is required to finish the install. #> Start-ChocolateyProcessAsAdmin "/qn /norestart /X{26A24AE4-039D-4CA4-87B4-2F83218045F0}" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010) Start-ChocolateyProcessAsAdmin "/qn /norestart /X{26A24AE4-039D-4CA4-87B4-2F86418045F0}" -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*$') return @{ 'x86_32' = $productSearch | Where-Object {$_.Name -match $nameRegex32 -and $_.Version -match $versionRegex} 'x86_64' = $productSearch | Where-Object {$_.Name -match $nameRegex64 -and $_.Version -match $versionRegex} } }
- tools\uninstall-oldJre.ps1
Show
function uninstall-oldJre ($oldVersion) { Write-Debug ("Starting the uninstallation of JRE version $oldVersion") <# Exit Codes: 0: Java installed successfully. 1605: Java is not installed. 3010: A reboot is required to finish the install. #> Write-Warning "Uninstalling JRE version $oldVersion" Start-ChocolateyProcessAsAdmin "/qn /norestart /X{26A24AE4-039D-4CA4-87B4-2F83218040F0}" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010) Start-ChocolateyProcessAsAdmin "/qn /norestart /X{26A24AE4-039D-4CA4-87B4-2F86418040F0}" -exeToRun "msiexec.exe" -validExitCodes @(0,1605,3010) Write-Warning "The computer may require a reboot to finish the uninstallation" }
Virus Scan Results
- jre8.8.0.45.nupkg (503bc8ba1364) - ## / 57 - Log in or click on link to see number of positives
- jre-8u45-windows-i586.exe&BHost=javadl.sun.com&File=jre-8u45-windows-i586.exe&AuthParam=1462270191_fb8a129ea9349b178dec6d45f8a2bc1c&ext=.exe (8dc948d6a95a) - ## / 56 - Log in or click on link to see number of positives
- jre-8u45-windows-x64.exe&BHost=javadl.sun.com&File=jre-8u45-windows-x64.exe&AuthParam=1462270199_f2ba9e2d233848fd2eb6f3a370dd926f&ext=.exe (9e3dc154720f) - ## / 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.201 | 371007 | Wednesday, January 23, 2019 | approved |
Java SE Runtime Environment 8.0.191.20181114 | 721957 | Wednesday, November 14, 2018 | approved |
Java SE Runtime Environment 8.0.191 | 149824 | Saturday, November 10, 2018 | approved |
Java SE Runtime Environment 8.0.181 | 1093508 | Wednesday, July 25, 2018 | approved |
Java SE Runtime Environment 8.0.171 | 686491 | Monday, April 30, 2018 | approved |
Java SE Runtime Environment 8.0.161 | 1283095 | Tuesday, January 23, 2018 | approved |
Java SE Runtime Environment 8.0.151 | 824771 | Friday, October 27, 2017 | approved |
Java SE Runtime Environment 8.0.144 | 658872 | Friday, August 11, 2017 | approved |
Java SE Runtime Environment 8.0.141 | 214476 | Thursday, July 20, 2017 | approved |
Java SE Runtime Environment 8.0.131 | 653949 | Friday, April 28, 2017 | 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.