├── .gitignore
├── LICENSE
├── README.md
├── bin
├── get-java.ps1
└── get-java.sh
├── build-jdk-stats.groovy
├── build-jdk.groovy
├── build-jdk.properties
├── build.xml
├── ivy.xml
├── makefile
├── package.properties
├── package
├── gpg
│ └── maintainer.gpg
├── icons
│ ├── java_256.svg
│ └── java_72.svg
├── qnap
│ ├── .gitignore
│ ├── icons
│ │ ├── @{package}.png
│ │ ├── @{package}_100.png
│ │ ├── @{package}_80.png
│ │ └── @{package}_gray.png
│ ├── makefile
│ ├── package_routines
│ ├── qpkg.cfg
│ └── shared
│ │ └── @{package}-service.sh
└── synology
│ ├── conf
│ ├── privilege
│ └── resource
│ ├── images
│ ├── java_256.png
│ ├── java_64.png
│ └── java_72.png
│ ├── scripts
│ ├── postinst
│ ├── postuninst
│ ├── postupgrade
│ ├── preinst
│ ├── preuninst
│ ├── preupgrade
│ └── start-stop-status
│ └── target
│ └── bin
│ └── java
├── release
├── get-java.ps1
├── get-java.ps1.asc
├── get-java.sh
└── get-java.sh.asc
├── src
├── get-java.ps1
└── get-java.sh
├── syno-dsm6.json
└── syno.json
/.gitignore:
--------------------------------------------------------------------------------
1 | lib
2 | build
3 | dist
4 | release
5 | cache
6 | gpg
7 |
8 | *.properties
9 |
10 | .DS_Store
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2018 Reinhard Pointner
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Java Installer
2 | [](https://github.com/rednoah/java-installer/releases)
3 | [](https://jdk.java.net/)
4 |
5 |
6 | ## Introduction
7 | This repository maintains packages for installing the latest OpenJDK binaries on Synology NAS and QNAP NAS.
8 |
9 |
10 | ## Installation on Synology DSM
11 | Add the following __Package Source__ to Synology DSM ► Package Center ► Settings ► Package Sources:
12 | ```
13 | https://get.filebot.net/syno/
14 | ```
15 |
16 |
17 | ## Installation on QNAP QTS
18 | Add the following __App Repository__ to QNAP QTS ► App Center ► Settings ► App Repository ► Add:
19 | ```
20 | https://get.filebot.net/qnap/index.xml
21 | ```
22 |
23 |
24 | ## Installation on Linux
25 | The [get-java.sh](https://github.com/rednoah/java-installer/blob/latest/release/get-java.sh) shell script should work on any Linux device:
26 |
27 | ```bash
28 | # Download the latest JDK into the current directory & link java to /usr/local/bin
29 | curl -O https://raw.githubusercontent.com/rednoah/java-installer/latest/release/get-java.sh
30 | sh get-java.sh install
31 | ```
32 |
33 |
34 | ## Installation on Windows
35 | The [get-java.ps1](https://github.com/rednoah/java-installer/blob/latest/release/get-java.ps1) PowerShell script requires Windows 8 or higher:
36 |
37 | ```powershell
38 | Invoke-WebRequest https://raw.githubusercontent.com/rednoah/java-installer/latest/release/get-java.ps1 -OutFile get-java.ps1 -UseBasicParsing
39 | powershell -File get-java.ps1 install
40 | ```
41 |
42 | The script uses `7z` to extract the `*.tar.gz` archive, but it will _not_ modify `JAVA_HOME` or the `PATH`.
43 |
44 |
45 | ## Supported Platforms
46 | * Linux (`x86_64`, `aarch64`, `armv7l`, `i686`, `ppc64le`)
47 | * Windows (`x86_64`, `x86`)
48 | * macOS (`x86_64`, `arm64`)
49 |
50 |
51 | ## Package Sources
52 | * [Adoptium](https://adoptium.net/)
53 | * [Liberica](https://bell-sw.com/pages/downloads/)
54 | * [Gluon](https://gluonhq.com/products/javafx/)
55 |
--------------------------------------------------------------------------------
/bin/get-java.ps1:
--------------------------------------------------------------------------------
1 | # Java Installer for OpenJDK 21.0.4
2 |
3 |
4 | param (
5 | [string]$command = 'get',
6 | [string]$type = 'jdk',
7 | [string]$arch = 'x86_64',
8 | [string]$os = 'Windows',
9 | [string]$out
10 | )
11 |
12 |
13 | $ErrorActionPreference = "Stop"
14 |
15 |
16 | Switch ("$os $arch $type") {
17 | "Linux x86_64 jdk" {
18 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_linux_hotspot_21.0.4_7.tar.gz"
19 | $JDK_SHA256 = "51fb4d03a4429c39d397d3a03a779077159317616550e4e71624c9843083e7b9"
20 | }
21 | "Linux i686 jdk" {
22 | $JDK_URL = "https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-i586.tar.gz"
23 | $JDK_SHA256 = "b71b565f674d6df46c88f51239bdfff2df074956f37f430d2556e1c66d9327bd"
24 | }
25 | "Linux aarch64 jdk" {
26 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.4_7.tar.gz"
27 | $JDK_SHA256 = "d768eecddd7a515711659e02caef8516b7b7177fa34880a56398fd9822593a79"
28 | }
29 | "Linux armv7l jdk" {
30 | $JDK_URL = "https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-arm32-vfp-hflt.tar.gz"
31 | $JDK_SHA256 = "a5ae23e5ca3df5322185f420c20fc80d48a1146f84219556fff05fbb16bf2375"
32 | }
33 | "Linux ppc64le jdk" {
34 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.4_7.tar.gz"
35 | $JDK_SHA256 = "c208cd0fb90560644a90f928667d2f53bfe408c957a5e36206585ad874427761"
36 | }
37 | "Linux riscv64 jdk" {
38 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_riscv64_linux_hotspot_21.0.4_7.tar.gz"
39 | $JDK_SHA256 = "b04fd7f52d18268a935f1a7144dae802b25db600ec97156ddd46b3100cbd13da"
40 | }
41 |
42 | "Darwin x86_64 jdk" {
43 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_mac_hotspot_21.0.4_7.tar.gz"
44 | $JDK_SHA256 = "e368e5de7111aa88e6bbabeff6f4c040772b57fb279cc4e197b51654085bbc18"
45 | }
46 | "Darwin arm64 jdk" {
47 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.4_7.tar.gz"
48 | $JDK_SHA256 = "dcf69a21601d9b1b25454bbad4f0f32784bb42cdbe4063492e15a851b74cb61e"
49 | }
50 |
51 | "Windows x86_64 jdk" {
52 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_windows_hotspot_21.0.4_7.zip"
53 | $JDK_SHA256 = "c725540d911531c366b985e5919efc8a73dd4030965cd9a740c3d2cd92c72c74"
54 | }
55 | "Windows x86 jdk" {
56 | $JDK_URL = "https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-i586.zip"
57 | $JDK_SHA256 = "ba50bb65f2a4ecc575532a35cec50a92b90af0bde49b07599d651add9e845c52"
58 | }
59 | "Windows aarch64 jdk" {
60 | $JDK_URL = "https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-aarch64.zip"
61 | $JDK_SHA256 = "49fd9fc0b838ee5b57dedf483194cb5de3f5a5e6453115843c05b920edbb417e"
62 | }
63 |
64 | "Linux x86_64 jfx" {
65 | $JDK_URL = "https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_linux-x64_bin-jmods.zip"
66 | $JDK_SHA256 = "2412d689c724f60c39ea878d8a3bd4c6abfb5d9856cafc1cc8a49e28dc12d221"
67 | }
68 |
69 | "Darwin x86_64 jfx" {
70 | $JDK_URL = "https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-x64_bin-jmods.zip"
71 | $JDK_SHA256 = "094c7e71c54473cf71086a67d4bfefa7c4fd6c6eb8d0f8be4785657c6c087e23"
72 | }
73 | "Darwin arm64 jfx" {
74 | $JDK_URL = "https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-aarch64_bin-jmods.zip"
75 | $JDK_SHA256 = "d510f6d13f522d5e5c4379bc3fea081da608aef62b77861dd0298af42529bf27"
76 | }
77 |
78 | "Windows x86_64 jfx" {
79 | $JDK_URL = "https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_windows-x64_bin-jmods.zip"
80 | $JDK_SHA256 = "f7cfa8e0e636c5cdf0f6aced810e703131783bf3d295797475e341b77fb037ee"
81 | }
82 |
83 | default {
84 | throw "Architecture not supported: $os $arch $type"
85 | }
86 | }
87 |
88 |
89 | # fetch JDK
90 | if ($out) {
91 | $JDK_TAR_GZ = $out
92 | } else {
93 | $JDK_TAR_GZ = Split-Path -Leaf $JDK_URL
94 | }
95 |
96 |
97 | if (!(test-path $JDK_TAR_GZ)) {
98 | Write-Output "Download $JDK_URL"
99 | (New-Object System.Net.WebClient).DownloadFile($JDK_URL, $JDK_TAR_GZ)
100 | }
101 |
102 |
103 | # verify archive via SHA-256 checksum
104 | $JDK_SHA256_ACTUAL = (Get-FileHash -Algorithm SHA256 $JDK_TAR_GZ).hash.toLower()
105 | Write-Output "Expected SHA256 checksum: $JDK_SHA256"
106 | Write-Output "Actual SHA256 checksum: $JDK_SHA256_ACTUAL"
107 |
108 | if ($JDK_SHA256 -ne $JDK_SHA256_ACTUAL) {
109 | throw "ERROR: SHA256 checksum mismatch"
110 | }
111 |
112 |
113 | # extract and link only if explicitly requested
114 | if ($command -ne "install") {
115 | Write-Output "Download complete: $JDK_TAR_GZ"
116 | return
117 | }
118 |
119 |
120 | # extract zip archive
121 | Write-Output "Extract $JDK_TAR_GZ"
122 | Expand-Archive -Path $JDK_TAR_GZ -DestinationPath .
123 |
124 |
125 | # find java executable
126 | $JAVA_EXE = Get-ChildItem -recurse -include java.exe | Sort-Object LastWriteTime | Select-Object -ExpandProperty FullName -Last 1
127 |
128 | # test
129 | Write-Output "Execute ""$JAVA_EXE"" -XshowSettings -version"
130 | & $JAVA_EXE -XshowSettings -version
131 |
132 |
133 | # set %JAVA_HOME% and add java to %PATH%
134 | $JAVA_HOME = Split-Path -Parent (Split-Path -Parent $JAVA_EXE)
135 |
136 | Write-Output "`nPlease add JAVA_HOME\bin to the PATH if you have not done so already:"
137 | Write-Output "`n`t%JAVA_HOME%\bin"
138 | Write-Output "`nPlease set JAVA_HOME:"
139 | Write-Output "`n`tsetx JAVA_HOME ""$JAVA_HOME"""
140 |
--------------------------------------------------------------------------------
/bin/get-java.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Java Installer for OpenJDK 21.0.4
4 |
5 | COMMAND=${1:-get} # get | install
6 | TYPE=${2:-jdk} # jre | jdk
7 | ARCH=${3:-`uname -m`} # x86_64 | i686 | aarch64 | armv7l | etc
8 | OS=${4:-`uname -s`} # Linux | Darwin | Windows | etc
9 |
10 | case "$OS $ARCH $TYPE" in
11 | "Linux x86_64 jdk")
12 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_linux_hotspot_21.0.4_7.tar.gz"
13 | JDK_SHA256="51fb4d03a4429c39d397d3a03a779077159317616550e4e71624c9843083e7b9"
14 | ;;
15 | "Linux i686 jdk")
16 | JDK_URL="https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-i586.tar.gz"
17 | JDK_SHA256="b71b565f674d6df46c88f51239bdfff2df074956f37f430d2556e1c66d9327bd"
18 | ;;
19 | "Linux aarch64 jdk")
20 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.4_7.tar.gz"
21 | JDK_SHA256="d768eecddd7a515711659e02caef8516b7b7177fa34880a56398fd9822593a79"
22 | ;;
23 | "Linux armv7l jdk")
24 | JDK_URL="https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-arm32-vfp-hflt.tar.gz"
25 | JDK_SHA256="a5ae23e5ca3df5322185f420c20fc80d48a1146f84219556fff05fbb16bf2375"
26 | ;;
27 | "Linux ppc64le jdk")
28 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.4_7.tar.gz"
29 | JDK_SHA256="c208cd0fb90560644a90f928667d2f53bfe408c957a5e36206585ad874427761"
30 | ;;
31 | "Linux riscv64 jdk")
32 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_riscv64_linux_hotspot_21.0.4_7.tar.gz"
33 | JDK_SHA256="b04fd7f52d18268a935f1a7144dae802b25db600ec97156ddd46b3100cbd13da"
34 | ;;
35 |
36 | "Darwin x86_64 jdk")
37 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_mac_hotspot_21.0.4_7.tar.gz"
38 | JDK_SHA256="e368e5de7111aa88e6bbabeff6f4c040772b57fb279cc4e197b51654085bbc18"
39 | ;;
40 | "Darwin arm64 jdk")
41 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.4_7.tar.gz"
42 | JDK_SHA256="dcf69a21601d9b1b25454bbad4f0f32784bb42cdbe4063492e15a851b74cb61e"
43 | ;;
44 |
45 | "Windows x86_64 jdk")
46 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_windows_hotspot_21.0.4_7.zip"
47 | JDK_SHA256="c725540d911531c366b985e5919efc8a73dd4030965cd9a740c3d2cd92c72c74"
48 | ;;
49 | "Windows x86 jdk")
50 | JDK_URL="https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-i586.zip"
51 | JDK_SHA256="ba50bb65f2a4ecc575532a35cec50a92b90af0bde49b07599d651add9e845c52"
52 | ;;
53 | "Windows aarch64 jdk")
54 | JDK_URL="https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-aarch64.zip"
55 | JDK_SHA256="49fd9fc0b838ee5b57dedf483194cb5de3f5a5e6453115843c05b920edbb417e"
56 | ;;
57 |
58 | "Linux x86_64 jfx")
59 | JDK_URL="https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_linux-x64_bin-jmods.zip"
60 | JDK_SHA256="2412d689c724f60c39ea878d8a3bd4c6abfb5d9856cafc1cc8a49e28dc12d221"
61 | ;;
62 |
63 | "Darwin x86_64 jfx")
64 | JDK_URL="https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-x64_bin-jmods.zip"
65 | JDK_SHA256="094c7e71c54473cf71086a67d4bfefa7c4fd6c6eb8d0f8be4785657c6c087e23"
66 | ;;
67 | "Darwin arm64 jfx")
68 | JDK_URL="https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-aarch64_bin-jmods.zip"
69 | JDK_SHA256="d510f6d13f522d5e5c4379bc3fea081da608aef62b77861dd0298af42529bf27"
70 | ;;
71 |
72 | "Windows x86_64 jfx")
73 | JDK_URL="https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_windows-x64_bin-jmods.zip"
74 | JDK_SHA256="f7cfa8e0e636c5cdf0f6aced810e703131783bf3d295797475e341b77fb037ee"
75 | ;;
76 |
77 | *)
78 | echo "Architecture not supported: $OS $ARCH $TYPE"
79 | exit 1
80 | ;;
81 | esac
82 |
83 |
84 | # fetch JDK
85 | JDK_TAR_GZ=${5:-`basename $JDK_URL`}
86 |
87 | if [ ! -f "$JDK_TAR_GZ" ]; then
88 | echo "Download $JDK_URL"
89 | curl -fsSL -o "$JDK_TAR_GZ" --retry 5 "$JDK_URL"
90 | fi
91 |
92 |
93 | # verify archive via SHA-256 checksum
94 | JDK_SHA256_ACTUAL=`openssl dgst -sha256 -hex "$JDK_TAR_GZ" | awk '{print $NF}'`
95 | echo "Expected SHA256 checksum: $JDK_SHA256"
96 | echo "Actual SHA256 checksum: $JDK_SHA256_ACTUAL"
97 |
98 | if [ "$JDK_SHA256" != "$JDK_SHA256_ACTUAL" ]; then
99 | echo "ERROR: SHA256 checksum mismatch"
100 | exit 1
101 | fi
102 |
103 |
104 | # extract and link only if explicitly requested
105 | if [ "$COMMAND" != "install" ]; then
106 | echo "Download complete: $JDK_TAR_GZ"
107 | exit 0
108 | fi
109 |
110 |
111 | echo "Extract $JDK_TAR_GZ"
112 | tar -v -zxf "$JDK_TAR_GZ"
113 |
114 | # find java executable
115 | JAVA_EXE=`find "$PWD" -name "java" -type f | head -n 1`
116 |
117 | # link executable into /usr/local/bin/java
118 | mkdir -p "/usr/local/bin"
119 | ln -s -f "$JAVA_EXE" "/usr/local/bin/java"
120 |
121 | # link java home to /usr/local/java
122 | JAVA_BIN=`dirname $JAVA_EXE`
123 | JAVA_HOME=`dirname $JAVA_BIN`
124 | ln -s -f "$JAVA_HOME" "/usr/local/java"
125 |
126 | # test
127 | echo "Execute $JAVA_EXE -XshowSettings -version"
128 | "$JAVA_EXE" -XshowSettings -version
129 |
--------------------------------------------------------------------------------
/build-jdk-stats.groovy:
--------------------------------------------------------------------------------
1 | import groovy.json.*
2 |
3 | // get download count from GitHub API
4 | def json = new JsonSlurper().parse(new URL('https://api.github.com/repos/rednoah/java-installer/releases'))
5 |
6 | def stats = [
7 | download_count: json.assets.download_count.flatten().sum()
8 | ]
9 |
10 | println stats
11 |
12 | // export stats to ant build
13 | stats.each{ p, v -> project.setProperty(p, v as String) }
14 |
--------------------------------------------------------------------------------
/build-jdk.groovy:
--------------------------------------------------------------------------------
1 | // Eclipse Adoptium OpenJDK for all platforms
2 | def adoptium = [
3 | [os: 'windows', arch: 'x64'],
4 | [os: 'mac', arch: 'x64'],
5 | [os: 'mac', arch: 'aarch64'],
6 | [os: 'linux', arch: 'x64'],
7 | [os: 'linux', arch: 'aarch64'],
8 | [os: 'linux', arch: 'ppc64le'],
9 | [os: 'linux', arch: 'riscv64']
10 | ]
11 |
12 | // BellSoft Liberica JDK for embedded devices
13 | def liberica = [
14 | [type: 'jdk', os: 'linux', arch: 'x86', pkg: 'linux-i586.tar.gz'],
15 | [type: 'jdk', os: 'linux', arch: 'arm', pkg: 'linux-arm32-vfp-hflt.tar.gz'],
16 | [type: 'jdk', os: 'windows', arch: 'x32', pkg: 'windows-i586.zip'],
17 | [type: 'jdk', os: 'windows', arch: 'aarch64', pkg: 'windows-aarch64.zip']
18 | ]
19 |
20 | // Gluon OpenJFX
21 | def javafx = [
22 | [os: 'windows', arch: 'x64', pkg: 'windows-x64_bin-jmods.zip'],
23 | [os: 'linux', arch: 'x64', pkg: 'linux-x64_bin-jmods.zip'],
24 | [os: 'mac', arch: 'x64', pkg: 'osx-x64_bin-jmods.zip'],
25 | [os: 'mac', arch: 'aarch64', pkg: 'osx-aarch64_bin-jmods.zip']
26 | ]
27 |
28 |
29 | // General Build Properties
30 | def name = properties.product
31 | def version = properties.release
32 |
33 |
34 | // generate properties file
35 | ant.propertyfile(file: 'build-jdk.properties', comment: "${name} ${version} binaries") {
36 | entry(key: 'jdk.name', value: name)
37 | entry(key: 'jdk.version', value: version)
38 |
39 | // Eclipse Adoptium Assets
40 | def assets = new groovy.json.JsonSlurper().parse(new URL("https://api.adoptium.net/v3/assets/version/${properties.adoptium_release}"))
41 |
42 | adoptium.each{ jdk ->
43 | jdk.with {
44 | def pkg = assets[0].binaries.find{ a -> os == a.os && arch == a.architecture && 'jdk' == a.image_type }
45 | if (pkg) {
46 | println pkg.package.link
47 | entry(key:"jdk.${os}.${arch}.url", value: pkg.package.link)
48 | entry(key:"jdk.${os}.${arch}.sha256", value: pkg.package.checksum)
49 | } else {
50 | println "$jdk not found"
51 | }
52 | }
53 | }
54 |
55 | liberica.each{ jdk ->
56 | def build = properties.liberica_release
57 | def cache = properties.'dir.cache'
58 |
59 | jdk.with {
60 | def url = "https://download.bell-sw.com/java/${build}/bellsoft-${type}${build}-${pkg}"
61 | println url
62 |
63 | def file = new File(cache, url.tokenize('/').last())
64 | new groovy.ant.AntBuilder().get(src: url, dest: file, skipExisting: 'yes')
65 | def checksum = file.bytes.digest('SHA-256').padLeft(64, '0')
66 |
67 | entry(key:"${type}.${os}.${arch}.url", value: url)
68 | entry(key:"${type}.${os}.${arch}.sha256", value: checksum)
69 | }
70 | }
71 |
72 | javafx.each{ jfx ->
73 | def release = properties.openjfx_release
74 | jfx.with {
75 | def url = "https://download2.gluonhq.com/openjfx/${release}/openjfx-${release}_${pkg}"
76 | def checksum = new URL("${url}.sha256").text.tokenize().first()
77 | println url
78 |
79 | entry(key:"jfx.${os}.${arch}.url", value: url)
80 | entry(key:"jfx.${os}.${arch}.sha256", value: checksum)
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/build-jdk.properties:
--------------------------------------------------------------------------------
1 | #OpenJDK 21.0.4 binaries
2 | #Thu, 01 May 2025 10:54:01 +0200
3 |
4 | jdk.name=OpenJDK
5 | jdk.version=21.0.4
6 | jdk.windows.x64.url=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_windows_hotspot_21.0.4_7.zip
7 | jdk.windows.x64.sha256=c725540d911531c366b985e5919efc8a73dd4030965cd9a740c3d2cd92c72c74
8 | jdk.mac.x64.url=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_mac_hotspot_21.0.4_7.tar.gz
9 | jdk.mac.x64.sha256=e368e5de7111aa88e6bbabeff6f4c040772b57fb279cc4e197b51654085bbc18
10 | jdk.mac.aarch64.url=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.4_7.tar.gz
11 | jdk.mac.aarch64.sha256=dcf69a21601d9b1b25454bbad4f0f32784bb42cdbe4063492e15a851b74cb61e
12 | jdk.linux.x64.url=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_linux_hotspot_21.0.4_7.tar.gz
13 | jdk.linux.x64.sha256=51fb4d03a4429c39d397d3a03a779077159317616550e4e71624c9843083e7b9
14 | jdk.linux.aarch64.url=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.4_7.tar.gz
15 | jdk.linux.aarch64.sha256=d768eecddd7a515711659e02caef8516b7b7177fa34880a56398fd9822593a79
16 | jdk.linux.ppc64le.url=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.4_7.tar.gz
17 | jdk.linux.ppc64le.sha256=c208cd0fb90560644a90f928667d2f53bfe408c957a5e36206585ad874427761
18 | jdk.linux.riscv64.url=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_riscv64_linux_hotspot_21.0.4_7.tar.gz
19 | jdk.linux.riscv64.sha256=b04fd7f52d18268a935f1a7144dae802b25db600ec97156ddd46b3100cbd13da
20 | jdk.linux.x86.url=https\://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-i586.tar.gz
21 | jdk.linux.x86.sha256=b71b565f674d6df46c88f51239bdfff2df074956f37f430d2556e1c66d9327bd
22 | jdk.linux.arm.url=https\://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-arm32-vfp-hflt.tar.gz
23 | jdk.linux.arm.sha256=a5ae23e5ca3df5322185f420c20fc80d48a1146f84219556fff05fbb16bf2375
24 | jdk.windows.x32.url=https\://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-i586.zip
25 | jdk.windows.x32.sha256=ba50bb65f2a4ecc575532a35cec50a92b90af0bde49b07599d651add9e845c52
26 | jdk.windows.aarch64.url=https\://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-aarch64.zip
27 | jdk.windows.aarch64.sha256=49fd9fc0b838ee5b57dedf483194cb5de3f5a5e6453115843c05b920edbb417e
28 | jfx.windows.x64.url=https\://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_windows-x64_bin-jmods.zip
29 | jfx.windows.x64.sha256=f7cfa8e0e636c5cdf0f6aced810e703131783bf3d295797475e341b77fb037ee
30 | jfx.linux.x64.url=https\://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_linux-x64_bin-jmods.zip
31 | jfx.linux.x64.sha256=2412d689c724f60c39ea878d8a3bd4c6abfb5d9856cafc1cc8a49e28dc12d221
32 | jfx.mac.x64.url=https\://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-x64_bin-jmods.zip
33 | jfx.mac.x64.sha256=094c7e71c54473cf71086a67d4bfefa7c4fd6c6eb8d0f8be4785657c6c087e23
34 | jfx.mac.aarch64.url=https\://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-aarch64_bin-jmods.zip
35 | jfx.mac.aarch64.sha256=d510f6d13f522d5e5c4379bc3fea081da608aef62b77861dd0298af42529bf27
36 |
--------------------------------------------------------------------------------
/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
The latest OpenJDK has been installed successfully.
$ java -version' 57 | cat "$SYNOPKG_PKGDEST/version" 58 | echo '' 59 | ) >> "$SYNOPKG_TEMP_LOGFILE" 2>&1 60 | else 61 | # display error message 62 | echo "Ooops, something went wrong... Run cat $PKG_LOG for details." >> "$SYNOPKG_TEMP_LOGFILE" 63 | fi 64 | exit 0 65 | ;; 66 | 67 | 68 | start) 69 | # check for updates once per month 70 | if [ ! -x "$INSTALLER_FILE" ] || [ $(find "$SYNOPKG_PKGDEST" -type f -name '*.asc' -maxdepth 1 -mtime +30 | wc -l) -gt 0 ]; then 71 | $0 install > "$PKG_LOG" 2>&1 72 | fi 73 | exit 0 74 | ;; 75 | 76 | 77 | stop) 78 | exit 0 79 | ;; 80 | 81 | 82 | status) 83 | if [ "/usr/local/bin/java" -ef "$SYNOPKG_PKGDEST/bin/java" ] && [ -f "$SYNOPKG_PKGDEST/release" ]; then 84 | exit 0 85 | else 86 | exit 150 # package is broken and should be reinstalled 87 | fi 88 | ;; 89 | 90 | 91 | log) 92 | echo "$PKG_LOG" 93 | exit 0 94 | ;; 95 | 96 | 97 | *) 98 | echo "Usage: $0 {start|stop|status|log}" 99 | exit 1 100 | ;; 101 | esac 102 | -------------------------------------------------------------------------------- /package/synology/target/bin/java: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | cat "/var/packages/java-installer/target/install-java.log" 1>&2 3 | exit 150 4 | -------------------------------------------------------------------------------- /release/get-java.ps1: -------------------------------------------------------------------------------- 1 | # Java Installer for OpenJDK 21.0.4 2 | 3 | 4 | param ( 5 | [string]$command = 'get', 6 | [string]$type = 'jdk', 7 | [string]$arch = 'x86_64', 8 | [string]$os = 'Windows', 9 | [string]$out 10 | ) 11 | 12 | 13 | $ErrorActionPreference = "Stop" 14 | 15 | 16 | Switch ("$os $arch $type") { 17 | "Linux x86_64 jdk" { 18 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_linux_hotspot_21.0.4_7.tar.gz" 19 | $JDK_SHA256 = "51fb4d03a4429c39d397d3a03a779077159317616550e4e71624c9843083e7b9" 20 | } 21 | "Linux i686 jdk" { 22 | $JDK_URL = "https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-i586.tar.gz" 23 | $JDK_SHA256 = "b71b565f674d6df46c88f51239bdfff2df074956f37f430d2556e1c66d9327bd" 24 | } 25 | "Linux aarch64 jdk" { 26 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.4_7.tar.gz" 27 | $JDK_SHA256 = "d768eecddd7a515711659e02caef8516b7b7177fa34880a56398fd9822593a79" 28 | } 29 | "Linux armv7l jdk" { 30 | $JDK_URL = "https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-arm32-vfp-hflt.tar.gz" 31 | $JDK_SHA256 = "a5ae23e5ca3df5322185f420c20fc80d48a1146f84219556fff05fbb16bf2375" 32 | } 33 | "Linux ppc64le jdk" { 34 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.4_7.tar.gz" 35 | $JDK_SHA256 = "c208cd0fb90560644a90f928667d2f53bfe408c957a5e36206585ad874427761" 36 | } 37 | "Linux riscv64 jdk" { 38 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_riscv64_linux_hotspot_21.0.4_7.tar.gz" 39 | $JDK_SHA256 = "b04fd7f52d18268a935f1a7144dae802b25db600ec97156ddd46b3100cbd13da" 40 | } 41 | 42 | "Darwin x86_64 jdk" { 43 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_mac_hotspot_21.0.4_7.tar.gz" 44 | $JDK_SHA256 = "e368e5de7111aa88e6bbabeff6f4c040772b57fb279cc4e197b51654085bbc18" 45 | } 46 | "Darwin arm64 jdk" { 47 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.4_7.tar.gz" 48 | $JDK_SHA256 = "dcf69a21601d9b1b25454bbad4f0f32784bb42cdbe4063492e15a851b74cb61e" 49 | } 50 | 51 | "Windows x86_64 jdk" { 52 | $JDK_URL = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_windows_hotspot_21.0.4_7.zip" 53 | $JDK_SHA256 = "c725540d911531c366b985e5919efc8a73dd4030965cd9a740c3d2cd92c72c74" 54 | } 55 | "Windows x86 jdk" { 56 | $JDK_URL = "https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-i586.zip" 57 | $JDK_SHA256 = "ba50bb65f2a4ecc575532a35cec50a92b90af0bde49b07599d651add9e845c52" 58 | } 59 | "Windows aarch64 jdk" { 60 | $JDK_URL = "https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-aarch64.zip" 61 | $JDK_SHA256 = "49fd9fc0b838ee5b57dedf483194cb5de3f5a5e6453115843c05b920edbb417e" 62 | } 63 | 64 | "Linux x86_64 jfx" { 65 | $JDK_URL = "https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_linux-x64_bin-jmods.zip" 66 | $JDK_SHA256 = "2412d689c724f60c39ea878d8a3bd4c6abfb5d9856cafc1cc8a49e28dc12d221" 67 | } 68 | 69 | "Darwin x86_64 jfx" { 70 | $JDK_URL = "https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-x64_bin-jmods.zip" 71 | $JDK_SHA256 = "094c7e71c54473cf71086a67d4bfefa7c4fd6c6eb8d0f8be4785657c6c087e23" 72 | } 73 | "Darwin arm64 jfx" { 74 | $JDK_URL = "https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-aarch64_bin-jmods.zip" 75 | $JDK_SHA256 = "d510f6d13f522d5e5c4379bc3fea081da608aef62b77861dd0298af42529bf27" 76 | } 77 | 78 | "Windows x86_64 jfx" { 79 | $JDK_URL = "https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_windows-x64_bin-jmods.zip" 80 | $JDK_SHA256 = "f7cfa8e0e636c5cdf0f6aced810e703131783bf3d295797475e341b77fb037ee" 81 | } 82 | 83 | default { 84 | throw "Architecture not supported: $os $arch $type" 85 | } 86 | } 87 | 88 | 89 | # fetch JDK 90 | if ($out) { 91 | $JDK_TAR_GZ = $out 92 | } else { 93 | $JDK_TAR_GZ = Split-Path -Leaf $JDK_URL 94 | } 95 | 96 | 97 | if (!(test-path $JDK_TAR_GZ)) { 98 | Write-Output "Download $JDK_URL" 99 | (New-Object System.Net.WebClient).DownloadFile($JDK_URL, $JDK_TAR_GZ) 100 | } 101 | 102 | 103 | # verify archive via SHA-256 checksum 104 | $JDK_SHA256_ACTUAL = (Get-FileHash -Algorithm SHA256 $JDK_TAR_GZ).hash.toLower() 105 | Write-Output "Expected SHA256 checksum: $JDK_SHA256" 106 | Write-Output "Actual SHA256 checksum: $JDK_SHA256_ACTUAL" 107 | 108 | if ($JDK_SHA256 -ne $JDK_SHA256_ACTUAL) { 109 | throw "ERROR: SHA256 checksum mismatch" 110 | } 111 | 112 | 113 | # extract and link only if explicitly requested 114 | if ($command -ne "install") { 115 | Write-Output "Download complete: $JDK_TAR_GZ" 116 | return 117 | } 118 | 119 | 120 | # extract zip archive 121 | Write-Output "Extract $JDK_TAR_GZ" 122 | Expand-Archive -Path $JDK_TAR_GZ -DestinationPath . 123 | 124 | 125 | # find java executable 126 | $JAVA_EXE = Get-ChildItem -recurse -include java.exe | Sort-Object LastWriteTime | Select-Object -ExpandProperty FullName -Last 1 127 | 128 | # test 129 | Write-Output "Execute ""$JAVA_EXE"" -XshowSettings -version" 130 | & $JAVA_EXE -XshowSettings -version 131 | 132 | 133 | # set %JAVA_HOME% and add java to %PATH% 134 | $JAVA_HOME = Split-Path -Parent (Split-Path -Parent $JAVA_EXE) 135 | 136 | Write-Output "`nPlease add JAVA_HOME\bin to the PATH if you have not done so already:" 137 | Write-Output "`n`t%JAVA_HOME%\bin" 138 | Write-Output "`nPlease set JAVA_HOME:" 139 | Write-Output "`n`tsetx JAVA_HOME ""$JAVA_HOME""" 140 | -------------------------------------------------------------------------------- /release/get-java.ps1.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iQJIBAABCAAyFiEEsJduUeXAR60P0FEpTkAuv3w8anEFAmgTNqoUHHJlZG5vYWhA 4 | ZmlsZWJvdC5uZXQACgkQTkAuv3w8anFQtA//YPKt1WYvJ/Qa4lYtR+aGeH4XYZ3p 5 | GplbJwmE5x4sEa+8P7Gh7wSvdPR3BoS2J7XuU03hmrmPPopH8Wg2mgCHnJrYeV8g 6 | ffOhAycmOq8Brkvn2eSGmZYiP5kvPJ78jsjVM4BBgPDH7gJ7CipOJ5ZV1iXGejwd 7 | nnBWG3KWrvNa9av6N6GNn2vxLjmg9Mdm8r2+pixE+WHk9sZ6H/+UQHtXWcrgBLLX 8 | MUg/UsUxu1F7YiK97u7eYlK3/ZVRDYgQdAYL61WzCZaPHs9OV6R9ZMeK0cWEgfGv 9 | Tv5+yRUpRgM//A7Qcu9FagUC/WLyJj5Y3lC+pV/RqwhRywH2JIA3UQlX3EbSIvGO 10 | bdns2xjDDMwh6VSs5mW8T0U2ULvUN5PP5zEBXJQxFcejUBgXG6EufJUCT6UZiW5j 11 | v7oDn7Bs31otuge/Yjk4HVAWBQ19BbVU++Lt5pGs0l+Jj/0ZsGuTBvCJ17GmkJDb 12 | jEUOewKrxSsJyzEuJYqnt4B5oXdJxCuspPX+QNTnDfRmN6PKFAozgNkvJaRRBqTr 13 | /WZdIi+V9EkF/t0ewz2nve4lX8czrkD89JfPbDvoaKqg4PcWNqg7CfdqvlkYWRp2 14 | j3Q6wUpyn4Ibzy+kjtvax1ghIDhcav/Bz1szzZ42IRU5xbEoRbLoCC9WACbQp6Bw 15 | oEOYSWPlY767/JE= 16 | =fitO 17 | -----END PGP SIGNATURE----- 18 | -------------------------------------------------------------------------------- /release/get-java.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Java Installer for OpenJDK 21.0.4 4 | 5 | COMMAND=${1:-get} # get | install 6 | TYPE=${2:-jdk} # jre | jdk 7 | ARCH=${3:-`uname -m`} # x86_64 | i686 | aarch64 | armv7l | etc 8 | OS=${4:-`uname -s`} # Linux | Darwin | Windows | etc 9 | 10 | case "$OS $ARCH $TYPE" in 11 | "Linux x86_64 jdk") 12 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_linux_hotspot_21.0.4_7.tar.gz" 13 | JDK_SHA256="51fb4d03a4429c39d397d3a03a779077159317616550e4e71624c9843083e7b9" 14 | ;; 15 | "Linux i686 jdk") 16 | JDK_URL="https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-i586.tar.gz" 17 | JDK_SHA256="b71b565f674d6df46c88f51239bdfff2df074956f37f430d2556e1c66d9327bd" 18 | ;; 19 | "Linux aarch64 jdk") 20 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.4_7.tar.gz" 21 | JDK_SHA256="d768eecddd7a515711659e02caef8516b7b7177fa34880a56398fd9822593a79" 22 | ;; 23 | "Linux armv7l jdk") 24 | JDK_URL="https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-linux-arm32-vfp-hflt.tar.gz" 25 | JDK_SHA256="a5ae23e5ca3df5322185f420c20fc80d48a1146f84219556fff05fbb16bf2375" 26 | ;; 27 | "Linux ppc64le jdk") 28 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.4_7.tar.gz" 29 | JDK_SHA256="c208cd0fb90560644a90f928667d2f53bfe408c957a5e36206585ad874427761" 30 | ;; 31 | "Linux riscv64 jdk") 32 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_riscv64_linux_hotspot_21.0.4_7.tar.gz" 33 | JDK_SHA256="b04fd7f52d18268a935f1a7144dae802b25db600ec97156ddd46b3100cbd13da" 34 | ;; 35 | 36 | "Darwin x86_64 jdk") 37 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_mac_hotspot_21.0.4_7.tar.gz" 38 | JDK_SHA256="e368e5de7111aa88e6bbabeff6f4c040772b57fb279cc4e197b51654085bbc18" 39 | ;; 40 | "Darwin arm64 jdk") 41 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.4_7.tar.gz" 42 | JDK_SHA256="dcf69a21601d9b1b25454bbad4f0f32784bb42cdbe4063492e15a851b74cb61e" 43 | ;; 44 | 45 | "Windows x86_64 jdk") 46 | JDK_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-jdk_x64_windows_hotspot_21.0.4_7.zip" 47 | JDK_SHA256="c725540d911531c366b985e5919efc8a73dd4030965cd9a740c3d2cd92c72c74" 48 | ;; 49 | "Windows x86 jdk") 50 | JDK_URL="https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-i586.zip" 51 | JDK_SHA256="ba50bb65f2a4ecc575532a35cec50a92b90af0bde49b07599d651add9e845c52" 52 | ;; 53 | "Windows aarch64 jdk") 54 | JDK_URL="https://download.bell-sw.com/java/21.0.4+9/bellsoft-jdk21.0.4+9-windows-aarch64.zip" 55 | JDK_SHA256="49fd9fc0b838ee5b57dedf483194cb5de3f5a5e6453115843c05b920edbb417e" 56 | ;; 57 | 58 | "Linux x86_64 jfx") 59 | JDK_URL="https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_linux-x64_bin-jmods.zip" 60 | JDK_SHA256="2412d689c724f60c39ea878d8a3bd4c6abfb5d9856cafc1cc8a49e28dc12d221" 61 | ;; 62 | 63 | "Darwin x86_64 jfx") 64 | JDK_URL="https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-x64_bin-jmods.zip" 65 | JDK_SHA256="094c7e71c54473cf71086a67d4bfefa7c4fd6c6eb8d0f8be4785657c6c087e23" 66 | ;; 67 | "Darwin arm64 jfx") 68 | JDK_URL="https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_osx-aarch64_bin-jmods.zip" 69 | JDK_SHA256="d510f6d13f522d5e5c4379bc3fea081da608aef62b77861dd0298af42529bf27" 70 | ;; 71 | 72 | "Windows x86_64 jfx") 73 | JDK_URL="https://download2.gluonhq.com/openjfx/21.0.4/openjfx-21.0.4_windows-x64_bin-jmods.zip" 74 | JDK_SHA256="f7cfa8e0e636c5cdf0f6aced810e703131783bf3d295797475e341b77fb037ee" 75 | ;; 76 | 77 | *) 78 | echo "Architecture not supported: $OS $ARCH $TYPE" 79 | exit 1 80 | ;; 81 | esac 82 | 83 | 84 | # fetch JDK 85 | JDK_TAR_GZ=${5:-`basename $JDK_URL`} 86 | 87 | if [ ! -f "$JDK_TAR_GZ" ]; then 88 | echo "Download $JDK_URL" 89 | curl -fsSL -o "$JDK_TAR_GZ" --retry 5 "$JDK_URL" 90 | fi 91 | 92 | 93 | # verify archive via SHA-256 checksum 94 | JDK_SHA256_ACTUAL=`openssl dgst -sha256 -hex "$JDK_TAR_GZ" | awk '{print $NF}'` 95 | echo "Expected SHA256 checksum: $JDK_SHA256" 96 | echo "Actual SHA256 checksum: $JDK_SHA256_ACTUAL" 97 | 98 | if [ "$JDK_SHA256" != "$JDK_SHA256_ACTUAL" ]; then 99 | echo "ERROR: SHA256 checksum mismatch" 100 | exit 1 101 | fi 102 | 103 | 104 | # extract and link only if explicitly requested 105 | if [ "$COMMAND" != "install" ]; then 106 | echo "Download complete: $JDK_TAR_GZ" 107 | exit 0 108 | fi 109 | 110 | 111 | echo "Extract $JDK_TAR_GZ" 112 | tar -v -zxf "$JDK_TAR_GZ" 113 | 114 | # find java executable 115 | JAVA_EXE=`find "$PWD" -name "java" -type f | head -n 1` 116 | 117 | # link executable into /usr/local/bin/java 118 | mkdir -p "/usr/local/bin" 119 | ln -s -f "$JAVA_EXE" "/usr/local/bin/java" 120 | 121 | # link java home to /usr/local/java 122 | JAVA_BIN=`dirname $JAVA_EXE` 123 | JAVA_HOME=`dirname $JAVA_BIN` 124 | ln -s -f "$JAVA_HOME" "/usr/local/java" 125 | 126 | # test 127 | echo "Execute $JAVA_EXE -XshowSettings -version" 128 | "$JAVA_EXE" -XshowSettings -version 129 | -------------------------------------------------------------------------------- /release/get-java.sh.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iQJIBAABCAAyFiEEsJduUeXAR60P0FEpTkAuv3w8anEFAmgTNqoUHHJlZG5vYWhA 4 | ZmlsZWJvdC5uZXQACgkQTkAuv3w8anHl7A/9E7dO2RN8PVzqNozbiw+XSxOlrK2R 5 | PSohtrO8qSbnaUo7tnUoxsHLdeYWLx53TidVGUKG/qasdyu0VWPsAAKR8JnR8rJq 6 | dKvSlzuA+iAtkMV+SuSRu/7rBHUJabey7zMacFZOtBNdmU6IWCYXmk3u6rwCu2RX 7 | JLxf1VxZ9yLzXSWAjgKGzOLxmuGM5w4FicHLROo8vLhAYP6iXcTXOaa7YDVto7+P 8 | Z/dGfNHlx6flWxlREPk6VzBi1ibG5ESaXD8cb3eqkFzLpht+gncx1i6Qv60Gh24+ 9 | JcNI+cjZtTj89r7gPfWtxJBl/Bi+O0/KST3z1R2vH3gHSMEUcn0MDj3HFjh9tpR5 10 | gJGQsjRxB8qCmFi9v60iAk0r1WUZKIMJXazxHAalR/yYdzJnnOPBXxWfdJ3YoOYG 11 | H2CdwA1A4EsI2hcwGMfV6Bm696iVzOeVLlqzCyMd06oZEdb53flKgiv0lSRWIijZ 12 | eOoRbnm/dBNh0eEPkyiOu9Imkvz1QhmW5LyvxyKYKz5mdnI5sZ9A6H2k1n1vNiAL 13 | BZ0W90VebMGbDYdCpbKIQaj1oe+w4eeZzMFK6AGrj4NfZZQ1QWe5GpvrZUbOYKjp 14 | G262TsfMZQdW74RDVZFJG3/G4FkojeRyb3pZVPxyGZADgm0dPthxY377UUQlLv2K 15 | iZHPxBLOkhleKtY= 16 | =JlpL 17 | -----END PGP SIGNATURE----- 18 | -------------------------------------------------------------------------------- /src/get-java.ps1: -------------------------------------------------------------------------------- 1 | # @{title} for @{jdk.name} @{jdk.version} 2 | 3 | 4 | param ( 5 | [string]$command = 'get', 6 | [string]$type = 'jdk', 7 | [string]$arch = 'x86_64', 8 | [string]$os = 'Windows', 9 | [string]$out 10 | ) 11 | 12 | 13 | $ErrorActionPreference = "Stop" 14 | 15 | 16 | Switch ("$os $arch $type") { 17 | "Linux x86_64 jdk" { 18 | $JDK_URL = "@{jdk.linux.x64.url}" 19 | $JDK_SHA256 = "@{jdk.linux.x64.sha256}" 20 | } 21 | "Linux i686 jdk" { 22 | $JDK_URL = "@{jdk.linux.x86.url}" 23 | $JDK_SHA256 = "@{jdk.linux.x86.sha256}" 24 | } 25 | "Linux aarch64 jdk" { 26 | $JDK_URL = "@{jdk.linux.aarch64.url}" 27 | $JDK_SHA256 = "@{jdk.linux.aarch64.sha256}" 28 | } 29 | "Linux armv7l jdk" { 30 | $JDK_URL = "@{jdk.linux.arm.url}" 31 | $JDK_SHA256 = "@{jdk.linux.arm.sha256}" 32 | } 33 | "Linux ppc64le jdk" { 34 | $JDK_URL = "@{jdk.linux.ppc64le.url}" 35 | $JDK_SHA256 = "@{jdk.linux.ppc64le.sha256}" 36 | } 37 | "Linux riscv64 jdk" { 38 | $JDK_URL = "@{jdk.linux.riscv64.url}" 39 | $JDK_SHA256 = "@{jdk.linux.riscv64.sha256}" 40 | } 41 | 42 | "Darwin x86_64 jdk" { 43 | $JDK_URL = "@{jdk.mac.x64.url}" 44 | $JDK_SHA256 = "@{jdk.mac.x64.sha256}" 45 | } 46 | "Darwin arm64 jdk" { 47 | $JDK_URL = "@{jdk.mac.aarch64.url}" 48 | $JDK_SHA256 = "@{jdk.mac.aarch64.sha256}" 49 | } 50 | 51 | "Windows x86_64 jdk" { 52 | $JDK_URL = "@{jdk.windows.x64.url}" 53 | $JDK_SHA256 = "@{jdk.windows.x64.sha256}" 54 | } 55 | "Windows x86 jdk" { 56 | $JDK_URL = "@{jdk.windows.x32.url}" 57 | $JDK_SHA256 = "@{jdk.windows.x32.sha256}" 58 | } 59 | "Windows aarch64 jdk" { 60 | $JDK_URL = "@{jdk.windows.aarch64.url}" 61 | $JDK_SHA256 = "@{jdk.windows.aarch64.sha256}" 62 | } 63 | 64 | "Linux x86_64 jfx" { 65 | $JDK_URL = "@{jfx.linux.x64.url}" 66 | $JDK_SHA256 = "@{jfx.linux.x64.sha256}" 67 | } 68 | 69 | "Darwin x86_64 jfx" { 70 | $JDK_URL = "@{jfx.mac.x64.url}" 71 | $JDK_SHA256 = "@{jfx.mac.x64.sha256}" 72 | } 73 | "Darwin arm64 jfx" { 74 | $JDK_URL = "@{jfx.mac.aarch64.url}" 75 | $JDK_SHA256 = "@{jfx.mac.aarch64.sha256}" 76 | } 77 | 78 | "Windows x86_64 jfx" { 79 | $JDK_URL = "@{jfx.windows.x64.url}" 80 | $JDK_SHA256 = "@{jfx.windows.x64.sha256}" 81 | } 82 | 83 | default { 84 | throw "Architecture not supported: $os $arch $type" 85 | } 86 | } 87 | 88 | 89 | # fetch JDK 90 | if ($out) { 91 | $JDK_TAR_GZ = $out 92 | } else { 93 | $JDK_TAR_GZ = Split-Path -Leaf $JDK_URL 94 | } 95 | 96 | 97 | if (!(test-path $JDK_TAR_GZ)) { 98 | Write-Output "Download $JDK_URL" 99 | (New-Object System.Net.WebClient).DownloadFile($JDK_URL, $JDK_TAR_GZ) 100 | } 101 | 102 | 103 | # verify archive via SHA-256 checksum 104 | $JDK_SHA256_ACTUAL = (Get-FileHash -Algorithm SHA256 $JDK_TAR_GZ).hash.toLower() 105 | Write-Output "Expected SHA256 checksum: $JDK_SHA256" 106 | Write-Output "Actual SHA256 checksum: $JDK_SHA256_ACTUAL" 107 | 108 | if ($JDK_SHA256 -ne $JDK_SHA256_ACTUAL) { 109 | throw "ERROR: SHA256 checksum mismatch" 110 | } 111 | 112 | 113 | # extract and link only if explicitly requested 114 | if ($command -ne "install") { 115 | Write-Output "Download complete: $JDK_TAR_GZ" 116 | return 117 | } 118 | 119 | 120 | # extract zip archive 121 | Write-Output "Extract $JDK_TAR_GZ" 122 | Expand-Archive -Path $JDK_TAR_GZ -DestinationPath . 123 | 124 | 125 | # find java executable 126 | $JAVA_EXE = Get-ChildItem -recurse -include java.exe | Sort-Object LastWriteTime | Select-Object -ExpandProperty FullName -Last 1 127 | 128 | # test 129 | Write-Output "Execute ""$JAVA_EXE"" -XshowSettings -version" 130 | & $JAVA_EXE -XshowSettings -version 131 | 132 | 133 | # set %JAVA_HOME% and add java to %PATH% 134 | $JAVA_HOME = Split-Path -Parent (Split-Path -Parent $JAVA_EXE) 135 | 136 | Write-Output "`nPlease add JAVA_HOME\bin to the PATH if you have not done so already:" 137 | Write-Output "`n`t%JAVA_HOME%\bin" 138 | Write-Output "`nPlease set JAVA_HOME:" 139 | Write-Output "`n`tsetx JAVA_HOME ""$JAVA_HOME""" 140 | -------------------------------------------------------------------------------- /src/get-java.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # @{title} for @{jdk.name} @{jdk.version} 4 | 5 | COMMAND=${1:-get} # get | install 6 | TYPE=${2:-jdk} # jre | jdk 7 | ARCH=${3:-`uname -m`} # x86_64 | i686 | aarch64 | armv7l | etc 8 | OS=${4:-`uname -s`} # Linux | Darwin | Windows | etc 9 | 10 | case "$OS $ARCH $TYPE" in 11 | "Linux x86_64 jdk") 12 | JDK_URL="@{jdk.linux.x64.url}" 13 | JDK_SHA256="@{jdk.linux.x64.sha256}" 14 | ;; 15 | "Linux i686 jdk") 16 | JDK_URL="@{jdk.linux.x86.url}" 17 | JDK_SHA256="@{jdk.linux.x86.sha256}" 18 | ;; 19 | "Linux aarch64 jdk") 20 | JDK_URL="@{jdk.linux.aarch64.url}" 21 | JDK_SHA256="@{jdk.linux.aarch64.sha256}" 22 | ;; 23 | "Linux armv7l jdk") 24 | JDK_URL="@{jdk.linux.arm.url}" 25 | JDK_SHA256="@{jdk.linux.arm.sha256}" 26 | ;; 27 | "Linux ppc64le jdk") 28 | JDK_URL="@{jdk.linux.ppc64le.url}" 29 | JDK_SHA256="@{jdk.linux.ppc64le.sha256}" 30 | ;; 31 | "Linux riscv64 jdk") 32 | JDK_URL="@{jdk.linux.riscv64.url}" 33 | JDK_SHA256="@{jdk.linux.riscv64.sha256}" 34 | ;; 35 | 36 | "Darwin x86_64 jdk") 37 | JDK_URL="@{jdk.mac.x64.url}" 38 | JDK_SHA256="@{jdk.mac.x64.sha256}" 39 | ;; 40 | "Darwin arm64 jdk") 41 | JDK_URL="@{jdk.mac.aarch64.url}" 42 | JDK_SHA256="@{jdk.mac.aarch64.sha256}" 43 | ;; 44 | 45 | "Windows x86_64 jdk") 46 | JDK_URL="@{jdk.windows.x64.url}" 47 | JDK_SHA256="@{jdk.windows.x64.sha256}" 48 | ;; 49 | "Windows x86 jdk") 50 | JDK_URL="@{jdk.windows.x32.url}" 51 | JDK_SHA256="@{jdk.windows.x32.sha256}" 52 | ;; 53 | "Windows aarch64 jdk") 54 | JDK_URL="@{jdk.windows.aarch64.url}" 55 | JDK_SHA256="@{jdk.windows.aarch64.sha256}" 56 | ;; 57 | 58 | "Linux x86_64 jfx") 59 | JDK_URL="@{jfx.linux.x64.url}" 60 | JDK_SHA256="@{jfx.linux.x64.sha256}" 61 | ;; 62 | 63 | "Darwin x86_64 jfx") 64 | JDK_URL="@{jfx.mac.x64.url}" 65 | JDK_SHA256="@{jfx.mac.x64.sha256}" 66 | ;; 67 | "Darwin arm64 jfx") 68 | JDK_URL="@{jfx.mac.aarch64.url}" 69 | JDK_SHA256="@{jfx.mac.aarch64.sha256}" 70 | ;; 71 | 72 | "Windows x86_64 jfx") 73 | JDK_URL="@{jfx.windows.x64.url}" 74 | JDK_SHA256="@{jfx.windows.x64.sha256}" 75 | ;; 76 | 77 | *) 78 | echo "Architecture not supported: $OS $ARCH $TYPE" 79 | exit 1 80 | ;; 81 | esac 82 | 83 | 84 | # fetch JDK 85 | JDK_TAR_GZ=${5:-`basename $JDK_URL`} 86 | 87 | if [ ! -f "$JDK_TAR_GZ" ]; then 88 | echo "Download $JDK_URL" 89 | curl -fsSL -o "$JDK_TAR_GZ" --retry 5 "$JDK_URL" 90 | fi 91 | 92 | 93 | # verify archive via SHA-256 checksum 94 | JDK_SHA256_ACTUAL=`openssl dgst -sha256 -hex "$JDK_TAR_GZ" | awk '{print $NF}'` 95 | echo "Expected SHA256 checksum: $JDK_SHA256" 96 | echo "Actual SHA256 checksum: $JDK_SHA256_ACTUAL" 97 | 98 | if [ "$JDK_SHA256" != "$JDK_SHA256_ACTUAL" ]; then 99 | echo "ERROR: SHA256 checksum mismatch" 100 | exit 1 101 | fi 102 | 103 | 104 | # extract and link only if explicitly requested 105 | if [ "$COMMAND" != "install" ]; then 106 | echo "Download complete: $JDK_TAR_GZ" 107 | exit 0 108 | fi 109 | 110 | 111 | echo "Extract $JDK_TAR_GZ" 112 | tar -v -zxf "$JDK_TAR_GZ" 113 | 114 | # find java executable 115 | JAVA_EXE=`find "$PWD" -name "java" -type f | head -n 1` 116 | 117 | # link executable into /usr/local/bin/java 118 | mkdir -p "/usr/local/bin" 119 | ln -s -f "$JAVA_EXE" "/usr/local/bin/java" 120 | 121 | # link java home to /usr/local/java 122 | JAVA_BIN=`dirname $JAVA_EXE` 123 | JAVA_HOME=`dirname $JAVA_BIN` 124 | ln -s -f "$JAVA_HOME" "/usr/local/java" 125 | 126 | # test 127 | echo "Execute $JAVA_EXE -XshowSettings -version" 128 | "$JAVA_EXE" -XshowSettings -version 129 | -------------------------------------------------------------------------------- /syno-dsm6.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | { 4 | "package": "java-installer", 5 | "version": "2.17", 6 | "dname": "Java Installer", 7 | "desc": "Java Installer will help you install and update Java. Supported platforms include armv7l, aarch64, i586 and x86_64 models. During the install, this package will download the latest OpenJDK binaries (180 MB) for your platform. This may take a while.", 8 | "maintainer": "rednoah", 9 | "maintainer_url": "https://github.com/rednoah/java-installer", 10 | "distributor": "rednoah", 11 | "distributor_url": "https://github.com/rednoah/java-installer", 12 | "start": false, 13 | "qstart": false, 14 | "qinst": false, 15 | "qupgrade": true, 16 | "thumbnail": [ 17 | "https://www.filebot.net/syno/java-installer-thumbnail.png" 18 | ], 19 | "link": "https://github.com/rednoah/java-installer/releases/download/2.17/java-installer_2.17-dsm6.spk", 20 | "download_count": "63474", 21 | "md5": "de7d54892df67634d29a12b96755815b", 22 | "sha256": "7627940589d81decd148f0dc414ccd89135daa36bda5eabcdd995e86abd8b5ec", 23 | "size": 40960 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /syno.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | { 4 | "package": "java-installer", 5 | "version": "2.17", 6 | "dname": "Java Installer", 7 | "desc": "Java Installer will help you install and update Java. Supported platforms include armv7l, aarch64, i586 and x86_64 models. During the install, this package will download the latest OpenJDK binaries (180 MB) for your platform. This may take a while.", 8 | "maintainer": "rednoah", 9 | "maintainer_url": "https://github.com/rednoah/java-installer", 10 | "distributor": "rednoah", 11 | "distributor_url": "https://github.com/rednoah/java-installer", 12 | "start": false, 13 | "qstart": false, 14 | "qinst": false, 15 | "qupgrade": true, 16 | "thumbnail": [ 17 | "https://www.filebot.net/syno/java-installer-thumbnail.png" 18 | ], 19 | "link": "https://github.com/rednoah/java-installer/releases/download/2.17/java-installer_2.17.spk", 20 | "download_count": "63474", 21 | "md5": "7bab008751b38245497193be45b8be2b", 22 | "sha256": "d566e7bac3ed68ce207b356ceb7fb6652589d0083059e6c0188642b3a6b9c25a", 23 | "size": 40960 24 | } 25 | ] 26 | } --------------------------------------------------------------------------------