Skip to content

Commit 5924392

Browse files
committedFeb 26, 2019
Remove OracleJDK. Not necessary anymore
Removed OracleJDK. Its licensing has gotten unfriendly and AndroidStudio already has OpenJDK bundled to make startup easier. Therefore I think we can let Oracle go.
1 parent 139d2a1 commit 5924392

5 files changed

+4
-105
lines changed
 

‎AndroidStudioPortable-Definitions.ps1

+1-15
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,7 @@ $AndroidStudioBatchFile =
6767
$GradleUserHomeDirectory =
6868
"$PortableHomeDirectory\.gradle"
6969

70-
## OpenJDK Java binaries
71-
$OpenJDK =
72-
'OpenJDK8U-jdk_x64_windows_hotspot_8u202b08'
73-
$OpenJDKName =
74-
'jdk8u202-b08'
75-
#Should Autogenerate from above
76-
$OpenJDKArchive =
77-
"$OpenJDK.zip"
78-
$OpenJDKURL =
79-
"https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/$OpenJDKName/$OpenJDKArchive"
80-
$OpenJDKDirectory =
81-
".\$OpenJDKName"
82-
$OpenJDKBinariesDirectory =
83-
"$OpenJDKDirectory\bin"
84-
70+
8571
### Tools Section. Shouldnt need to change ##
8672

8773
##7z File Expander

‎Remove-AndroidStudioPortable.ps1

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ $AndroidSDKRootDirectory =
3232
Get-RelativeRootDirectory -RelativePath $AndroidSDKDirectory
3333
$AndroidStudioRootDirectory =
3434
Get-RelativeRootDirectory -RelativePath $AndroidStudioDirectory
35-
$OracleJDKRootDirectory =
36-
Get-RelativeRootDirectory -RelativePath $OracleJDKDirectory
3735

3836
#
3937
# 260 characters workaround
@@ -46,8 +44,7 @@ $OracleJDKRootDirectory =
4644

4745
$InstalledPackages = @(
4846
$AndroidSDKRootDirectory,
49-
$AndroidStudioRootDirectory,
50-
$OracleJDKRootDirectory
47+
$AndroidStudioRootDirectory
5148
)
5249

5350
$RemoveItemParameters = @{

‎Remove-SetupTemporaryFiles.ps1

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ $TemporaryFiles = @(
1010
$7zBootStrapExec,
1111
$7zInstaller,
1212
$7zExecutable,
13-
$AndroidStudioArchive,
14-
$OracleJDKInstaller,
15-
$OracleJDKInternalArchive
13+
$AndroidStudioArchive
1614
)
1715

1816
$RemoveItemParameters = @{

‎Setup-AndroidStudioPortable.ps1

+1-79
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434

3535
$ToolsAreRequired =
3636
!(Test-Path -Path $AndroidSDKDirectory) -Or
37-
!(Test-Path -Path $AndroidStudioDirectory) -Or
38-
!(Test-Path -Path $OracleJDKDirectory)
37+
!(Test-Path -Path $AndroidStudioDirectory)
3938

4039
if ($ToolsAreRequired -And !(Test-Path -Path $aria2Directory))
4140
{
@@ -81,81 +80,6 @@ if (!(Test-Path -Path $AndroidStudioDirectory))
8180
& ".\$7zExecutable" 'x' $AndroidStudioArchive '-o*' '-bso0' '-bsp1' '-y'
8281
}
8382

84-
#
85-
# Download and unpack an Oracle JDK installer without administrative rights.
86-
#
87-
88-
if (!(Test-Path -Path $OracleJDKDirectory))
89-
{
90-
if (!(Test-Path -Path $OracleJDKInternalArchive))
91-
{
92-
if (!(Test-Path -Path $OracleJDKInternalCAB))
93-
{
94-
if (!(Test-Path -Path $OracleJDKInstaller))
95-
{
96-
#
97-
# Download the Oracle JDK installer accepting the
98-
#
99-
# `Oracle Binary Code License Agreement for Java SE`
100-
#
101-
102-
& ".\$aria2Directory\$aria2Executable" --header=$($OracleJDKdlCookie) -c -o $OracleJDKInstaller $OracleJDKURL
103-
104-
}
105-
106-
#
107-
# Unpack the Oracle JDK installer with 7-Zip.
108-
#
109-
110-
Write-Output "Unpack JDK installer"
111-
& ".\$7zDirectory\$7zExecutable" `
112-
'e' $OracleJDKInstaller `
113-
"$OracleJDKInternalCABPath\$OracleJDKInternalCAB" `
114-
'-y'
115-
}
116-
117-
#
118-
# Unpack the Oracle JDK Tools CAB with 7-Zip.
119-
#
120-
121-
Write-Output "Unpack JDK archive"
122-
& ".\$7zDirectory\$7zExecutable" `
123-
'e' $OracleJDKInternalCAB `
124-
"$OracleJDKInternalArchive" '-y'
125-
}
126-
127-
Write-Output "Unpack JDK"
128-
& ".\$7zDirectory\$7zExecutable" 'x' $OracleJDKInternalArchive `
129-
"-o$OracleJDKDirectory" '-y'
130-
}
131-
132-
#
133-
# Unpack Oracle JDK `.pack` files with the unpack200
134-
# utility bundled with the JDK.
135-
#
136-
137-
Write-Output "Expand JDK files"
138-
$GetChildItemParameters = @{
139-
Path = $OracleJDKDirectory;
140-
Filter = '*.pack';
141-
}
142-
$PackFiles =
143-
Get-ChildItem @GetChildItemParameters -Recurse
144-
145-
if ($PackFiles)
146-
{
147-
foreach ($File in $PackFiles)
148-
{
149-
$PackFileName =
150-
$File.FullName
151-
$JarFileName =
152-
"$($File.DirectoryName)\$($File.BaseName).jar"
153-
154-
& "$OracleJDKBinariesDirectory\unpack200" '-r' `
155-
$PackFileName $JarFileName
156-
}
157-
}
158-
15983
#
16084
# Create a new SDK directory.
16185
#
@@ -237,9 +161,7 @@ SET USERPROFILE=%~dp0$PortableHomeDirectory
237161
SET ANDROID_HOME=%~dp0$AndroidSDKDirectory
238162
SET ANDROID_SDK_HOME=%~dp0$PortableHomeDirectory
239163
SET GRADLE_USER_HOME=%~dp0$GradleUserHomeDirectory
240-
SET JAVA_HOME=%~dp0$OracleJDKDirectory
241164
242-
SET PATH=%~dp0$OracleJDKBinariesDirectory;%PATH%
243165
SET PATH=%~dp0$AndroidStudioBinariesDirectory;%PATH%
244166
SET PATH=$AndroidSDKBinariesPaths%PATH%
245167

‎Start-AndroidStudioPortable.ps1

-4
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ $env:ANDROID_SDK_HOME =
3232
Expand-Path -Path $PortableHomeDirectory
3333
$env:GRADLE_USER_HOME =
3434
Expand-Path -Path $GradleUserHomeDirectory
35-
$env:JAVA_HOME =
36-
Expand-Path -Path $OracleJDKDirectory
3735

38-
$env:PATH =
39-
"$(Expand-Path -Path $OracleJDKBinariesDirectory);$env:PATH"
4036
$env:PATH =
4137
"$(Expand-Path -Path $AndroidStudioBinariesDirectory);$env:PATH"
4238

0 commit comments

Comments
 (0)
Please sign in to comment.