├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── ADDITIONAL_LICENSE_INFO ├── ASSEMBLY_EXCEPTION ├── LICENSE ├── README.md ├── TRADEMARK ├── bin ├── envhook.sh └── openjdk.sh ├── images └── banner.svg └── snap ├── hooks ├── install └── post-refresh └── snapcraft.yaml /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | This template reproduces the [Java Bug](https://bugreport.java.com/bugreport/) form so that the issue can be reported upstream to the OpenJDK project, if appropriate. See [javafxports/openjdk-jfx#229](https://github.com/javafxports/openjdk-jfx/issues/229) for a good example of an issue using this template. 11 | 12 | ### Synopsis 13 | 14 | Enter a one line summary of your report. Please be specific. 15 | 16 | ### Description 17 | 18 | Enter a detailed description of the problem. Please describe only one problem per report. For multiple problems, file a separate report for each one. 19 | 20 | ### System / OS / Java Runtime Information 21 | 22 | Add additional system configuration information here. Copy and paste the output of the following commands into the code block below: 23 | 24 | ```console 25 | $ uname -srm 26 | 27 | $ getconf GNU_LIBC_VERSION 28 | 29 | $ java --version 30 | 31 | ``` 32 | 33 | ### Steps to Reproduce 34 | 35 | Describe the step-by-step process we can follow to reproduce this bug. 36 | 37 | ### Expected Results 38 | 39 | Describe the results you were expecting when performing the above steps. 40 | 41 | ### Actual Result 42 | 43 | Please report the actual results that you saw. Include the exact text of any error messages that appeared or any trace information available. 44 | 45 | ### Source code for an executable test case 46 | 47 | Add complete and compiling Java source code that demonstrates the problem. 48 | 49 | ### Workaround 50 | 51 | Please provide a temporary method for bypassing this bug, if you have found one. 52 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | This template reproduces the [Java Enhancement](https://bugreport.java.com/bugreport/) form so that the request can be reported upstream to the OpenJDK project, if appropriate. See [javafxports/openjdk-jfx#339](https://github.com/javafxports/openjdk-jfx/issues/339) for a good example of an issue that uses this template. 11 | 12 | ### Synopsis 13 | 14 | Enter a one line summary of the feature. Please be specific. 15 | 16 | ### Description 17 | 18 | Enter a detailed description of the feature. See the [JEP Template](https://openjdk.java.net/jeps/2) for a good list of subsections you might want to add to this description. 19 | 20 | ### System / OS / Java Runtime Information 21 | 22 | Add additional system configuration information here. Copy and paste the output of the following commands into the code block below: 23 | 24 | ```console 25 | $ uname -srm 26 | 27 | $ getconf GNU_LIBC_VERSION 28 | 29 | $ java --version 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Snapcraft 2 | /prime/ 3 | /*.snap 4 | /*.txt 5 | -------------------------------------------------------------------------------- /ADDITIONAL_LICENSE_INFO: -------------------------------------------------------------------------------- 1 | ADDITIONAL INFORMATION ABOUT LICENSING 2 | 3 | Certain files distributed by Oracle America, Inc. and/or its affiliates are 4 | subject to the following clarification and special exception to the GPLv2, 5 | based on the GNU Project exception for its Classpath libraries, known as the 6 | GNU Classpath Exception. 7 | 8 | Note that Oracle includes multiple, independent programs in this software 9 | package. Some of those programs are provided under licenses deemed 10 | incompatible with the GPLv2 by the Free Software Foundation and others. 11 | For example, the package includes programs licensed under the Apache 12 | License, Version 2.0 and may include FreeType. Such programs are licensed 13 | to you under their original licenses. 14 | 15 | Oracle facilitates your further distribution of this package by adding the 16 | Classpath Exception to the necessary parts of its GPLv2 code, which permits 17 | you to use that code in combination with other independent modules not 18 | licensed under the GPLv2. However, note that this would not permit you to 19 | commingle code under an incompatible license with Oracle's GPLv2 licensed 20 | code by, for example, cutting and pasting such code into a file also 21 | containing Oracle's GPLv2 licensed code and then distributing the result. 22 | 23 | Additionally, if you were to remove the Classpath Exception from any of the 24 | files to which it applies and distribute the result, you would likely be 25 | required to license some or all of the other code in that distribution under 26 | the GPLv2 as well, and since the GPLv2 is incompatible with the license terms 27 | of some items included in the distribution by Oracle, removing the Classpath 28 | Exception could therefore effectively compromise your ability to further 29 | distribute the package. 30 | 31 | Failing to distribute notices associated with some files may also create 32 | unexpected legal consequences. 33 | 34 | Proceed with caution and we recommend that you obtain the advice of a lawyer 35 | skilled in open source matters before removing the Classpath Exception or 36 | making modifications to this package which may subsequently be redistributed 37 | and/or involve the use of third party software. 38 | -------------------------------------------------------------------------------- /ASSEMBLY_EXCEPTION: -------------------------------------------------------------------------------- 1 | 2 | OPENJDK ASSEMBLY EXCEPTION 3 | 4 | The OpenJDK source code made available by Oracle America, Inc. (Oracle) at 5 | openjdk.org ("OpenJDK Code") is distributed under the terms of the GNU 6 | General Public License version 2 7 | only ("GPL2"), with the following clarification and special exception. 8 | 9 | Linking this OpenJDK Code statically or dynamically with other code 10 | is making a combined work based on this library. Thus, the terms 11 | and conditions of GPL2 cover the whole combination. 12 | 13 | As a special exception, Oracle gives you permission to link this 14 | OpenJDK Code with certain code licensed by Oracle as indicated at 15 | https://openjdk.org/legal/exception-modules-2007-05-08.html 16 | ("Designated Exception Modules") to produce an executable, 17 | regardless of the license terms of the Designated Exception Modules, 18 | and to copy and distribute the resulting executable under GPL2, 19 | provided that the Designated Exception Modules continue to be 20 | governed by the licenses under which they were offered by Oracle. 21 | 22 | As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code 23 | to build an executable that includes those portions of necessary code that 24 | Oracle could not provide under GPL2 (or that Oracle has provided under GPL2 25 | with the Classpath exception). If you modify or add to the OpenJDK code, 26 | that new GPL2 code may still be combined with Designated Exception Modules 27 | if the new code is made subject to this exception by its copyright holder. 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The GNU General Public License (GPL) 2 | 3 | Version 2, June 1991 4 | 5 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 6 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 7 | 8 | Everyone is permitted to copy and distribute verbatim copies of this license 9 | document, but changing it is not allowed. 10 | 11 | Preamble 12 | 13 | The licenses for most software are designed to take away your freedom to share 14 | and change it. By contrast, the GNU General Public License is intended to 15 | guarantee your freedom to share and change free software--to make sure the 16 | software is free for all its users. This General Public License applies to 17 | most of the Free Software Foundation's software and to any other program whose 18 | authors commit to using it. (Some other Free Software Foundation software is 19 | covered by the GNU Library General Public License instead.) You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not price. Our 23 | General Public Licenses are designed to make sure that you have the freedom to 24 | distribute copies of free software (and charge for this service if you wish), 25 | that you receive source code or can get it if you want it, that you can change 26 | the software or use pieces of it in new free programs; and that you know you 27 | can do these things. 28 | 29 | To protect your rights, we need to make restrictions that forbid anyone to deny 30 | you these rights or to ask you to surrender the rights. These restrictions 31 | translate to certain responsibilities for you if you distribute copies of the 32 | software, or if you modify it. 33 | 34 | For example, if you distribute copies of such a program, whether gratis or for 35 | a fee, you must give the recipients all the rights that you have. You must 36 | make sure that they, too, receive or can get the source code. And you must 37 | show them these terms so they know their rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and (2) 40 | offer you this license which gives you legal permission to copy, distribute 41 | and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain that 44 | everyone understands that there is no warranty for this free software. If the 45 | software is modified by someone else and passed on, we want its recipients to 46 | know that what they have is not the original, so that any problems introduced 47 | by others will not reflect on the original authors' reputations. 48 | 49 | Finally, any free program is threatened constantly by software patents. We 50 | wish to avoid the danger that redistributors of a free program will 51 | individually obtain patent licenses, in effect making the program proprietary. 52 | To prevent this, we have made it clear that any patent must be licensed for 53 | everyone's free use or not licensed at all. 54 | 55 | The precise terms and conditions for copying, distribution and modification 56 | follow. 57 | 58 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 59 | 60 | 0. This License applies to any program or other work which contains a notice 61 | placed by the copyright holder saying it may be distributed under the terms of 62 | this General Public License. The "Program", below, refers to any such program 63 | or work, and a "work based on the Program" means either the Program or any 64 | derivative work under copyright law: that is to say, a work containing the 65 | Program or a portion of it, either verbatim or with modifications and/or 66 | translated into another language. (Hereinafter, translation is included 67 | without limitation in the term "modification".) Each licensee is addressed as 68 | "you". 69 | 70 | Activities other than copying, distribution and modification are not covered by 71 | this License; they are outside its scope. The act of running the Program is 72 | not restricted, and the output from the Program is covered only if its contents 73 | constitute a work based on the Program (independent of having been made by 74 | running the Program). Whether that is true depends on what the Program does. 75 | 76 | 1. You may copy and distribute verbatim copies of the Program's source code as 77 | you receive it, in any medium, provided that you conspicuously and 78 | appropriately publish on each copy an appropriate copyright notice and 79 | disclaimer of warranty; keep intact all the notices that refer to this License 80 | and to the absence of any warranty; and give any other recipients of the 81 | Program a copy of this License along with the Program. 82 | 83 | You may charge a fee for the physical act of transferring a copy, and you may 84 | at your option offer warranty protection in exchange for a fee. 85 | 86 | 2. You may modify your copy or copies of the Program or any portion of it, thus 87 | forming a work based on the Program, and copy and distribute such modifications 88 | or work under the terms of Section 1 above, provided that you also meet all of 89 | these conditions: 90 | 91 | a) You must cause the modified files to carry prominent notices stating 92 | that you changed the files and the date of any change. 93 | 94 | b) You must cause any work that you distribute or publish, that in whole or 95 | in part contains or is derived from the Program or any part thereof, to be 96 | licensed as a whole at no charge to all third parties under the terms of 97 | this License. 98 | 99 | c) If the modified program normally reads commands interactively when run, 100 | you must cause it, when started running for such interactive use in the 101 | most ordinary way, to print or display an announcement including an 102 | appropriate copyright notice and a notice that there is no warranty (or 103 | else, saying that you provide a warranty) and that users may redistribute 104 | the program under these conditions, and telling the user how to view a copy 105 | of this License. (Exception: if the Program itself is interactive but does 106 | not normally print such an announcement, your work based on the Program is 107 | not required to print an announcement.) 108 | 109 | These requirements apply to the modified work as a whole. If identifiable 110 | sections of that work are not derived from the Program, and can be reasonably 111 | considered independent and separate works in themselves, then this License, and 112 | its terms, do not apply to those sections when you distribute them as separate 113 | works. But when you distribute the same sections as part of a whole which is a 114 | work based on the Program, the distribution of the whole must be on the terms 115 | of this License, whose permissions for other licensees extend to the entire 116 | whole, and thus to each and every part regardless of who wrote it. 117 | 118 | Thus, it is not the intent of this section to claim rights or contest your 119 | rights to work written entirely by you; rather, the intent is to exercise the 120 | right to control the distribution of derivative or collective works based on 121 | the Program. 122 | 123 | In addition, mere aggregation of another work not based on the Program with the 124 | Program (or with a work based on the Program) on a volume of a storage or 125 | distribution medium does not bring the other work under the scope of this 126 | License. 127 | 128 | 3. You may copy and distribute the Program (or a work based on it, under 129 | Section 2) in object code or executable form under the terms of Sections 1 and 130 | 2 above provided that you also do one of the following: 131 | 132 | a) Accompany it with the complete corresponding machine-readable source 133 | code, which must be distributed under the terms of Sections 1 and 2 above 134 | on a medium customarily used for software interchange; or, 135 | 136 | b) Accompany it with a written offer, valid for at least three years, to 137 | give any third party, for a charge no more than your cost of physically 138 | performing source distribution, a complete machine-readable copy of the 139 | corresponding source code, to be distributed under the terms of Sections 1 140 | and 2 above on a medium customarily used for software interchange; or, 141 | 142 | c) Accompany it with the information you received as to the offer to 143 | distribute corresponding source code. (This alternative is allowed only 144 | for noncommercial distribution and only if you received the program in 145 | object code or executable form with such an offer, in accord with 146 | Subsection b above.) 147 | 148 | The source code for a work means the preferred form of the work for making 149 | modifications to it. For an executable work, complete source code means all 150 | the source code for all modules it contains, plus any associated interface 151 | definition files, plus the scripts used to control compilation and installation 152 | of the executable. However, as a special exception, the source code 153 | distributed need not include anything that is normally distributed (in either 154 | source or binary form) with the major components (compiler, kernel, and so on) 155 | of the operating system on which the executable runs, unless that component 156 | itself accompanies the executable. 157 | 158 | If distribution of executable or object code is made by offering access to copy 159 | from a designated place, then offering equivalent access to copy the source 160 | code from the same place counts as distribution of the source code, even though 161 | third parties are not compelled to copy the source along with the object code. 162 | 163 | 4. You may not copy, modify, sublicense, or distribute the Program except as 164 | expressly provided under this License. Any attempt otherwise to copy, modify, 165 | sublicense or distribute the Program is void, and will automatically terminate 166 | your rights under this License. However, parties who have received copies, or 167 | rights, from you under this License will not have their licenses terminated so 168 | long as such parties remain in full compliance. 169 | 170 | 5. You are not required to accept this License, since you have not signed it. 171 | However, nothing else grants you permission to modify or distribute the Program 172 | or its derivative works. These actions are prohibited by law if you do not 173 | accept this License. Therefore, by modifying or distributing the Program (or 174 | any work based on the Program), you indicate your acceptance of this License to 175 | do so, and all its terms and conditions for copying, distributing or modifying 176 | the Program or works based on it. 177 | 178 | 6. Each time you redistribute the Program (or any work based on the Program), 179 | the recipient automatically receives a license from the original licensor to 180 | copy, distribute or modify the Program subject to these terms and conditions. 181 | You may not impose any further restrictions on the recipients' exercise of the 182 | rights granted herein. You are not responsible for enforcing compliance by 183 | third parties to this License. 184 | 185 | 7. If, as a consequence of a court judgment or allegation of patent 186 | infringement or for any other reason (not limited to patent issues), conditions 187 | are imposed on you (whether by court order, agreement or otherwise) that 188 | contradict the conditions of this License, they do not excuse you from the 189 | conditions of this License. If you cannot distribute so as to satisfy 190 | simultaneously your obligations under this License and any other pertinent 191 | obligations, then as a consequence you may not distribute the Program at all. 192 | For example, if a patent license would not permit royalty-free redistribution 193 | of the Program by all those who receive copies directly or indirectly through 194 | you, then the only way you could satisfy both it and this License would be to 195 | refrain entirely from distribution of the Program. 196 | 197 | If any portion of this section is held invalid or unenforceable under any 198 | particular circumstance, the balance of the section is intended to apply and 199 | the section as a whole is intended to apply in other circumstances. 200 | 201 | It is not the purpose of this section to induce you to infringe any patents or 202 | other property right claims or to contest validity of any such claims; this 203 | section has the sole purpose of protecting the integrity of the free software 204 | distribution system, which is implemented by public license practices. Many 205 | people have made generous contributions to the wide range of software 206 | distributed through that system in reliance on consistent application of that 207 | system; it is up to the author/donor to decide if he or she is willing to 208 | distribute software through any other system and a licensee cannot impose that 209 | choice. 210 | 211 | This section is intended to make thoroughly clear what is believed to be a 212 | consequence of the rest of this License. 213 | 214 | 8. If the distribution and/or use of the Program is restricted in certain 215 | countries either by patents or by copyrighted interfaces, the original 216 | copyright holder who places the Program under this License may add an explicit 217 | geographical distribution limitation excluding those countries, so that 218 | distribution is permitted only in or among countries not thus excluded. In 219 | such case, this License incorporates the limitation as if written in the body 220 | of this License. 221 | 222 | 9. The Free Software Foundation may publish revised and/or new versions of the 223 | General Public License from time to time. Such new versions will be similar in 224 | spirit to the present version, but may differ in detail to address new problems 225 | or concerns. 226 | 227 | Each version is given a distinguishing version number. If the Program 228 | specifies a version number of this License which applies to it and "any later 229 | version", you have the option of following the terms and conditions either of 230 | that version or of any later version published by the Free Software Foundation. 231 | If the Program does not specify a version number of this License, you may 232 | choose any version ever published by the Free Software Foundation. 233 | 234 | 10. If you wish to incorporate parts of the Program into other free programs 235 | whose distribution conditions are different, write to the author to ask for 236 | permission. For software which is copyrighted by the Free Software Foundation, 237 | write to the Free Software Foundation; we sometimes make exceptions for this. 238 | Our decision will be guided by the two goals of preserving the free status of 239 | all derivatives of our free software and of promoting the sharing and reuse of 240 | software generally. 241 | 242 | NO WARRANTY 243 | 244 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR 245 | THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE 246 | STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE 247 | PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 248 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 249 | FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 250 | PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, 251 | YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 252 | 253 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL 254 | ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE 255 | PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 256 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR 257 | INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA 258 | BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 259 | FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER 260 | OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 261 | 262 | END OF TERMS AND CONDITIONS 263 | 264 | How to Apply These Terms to Your New Programs 265 | 266 | If you develop a new program, and you want it to be of the greatest possible 267 | use to the public, the best way to achieve this is to make it free software 268 | which everyone can redistribute and change under these terms. 269 | 270 | To do so, attach the following notices to the program. It is safest to attach 271 | them to the start of each source file to most effectively convey the exclusion 272 | of warranty; and each file should have at least the "copyright" line and a 273 | pointer to where the full notice is found. 274 | 275 | One line to give the program's name and a brief idea of what it does. 276 | 277 | Copyright (C) 278 | 279 | This program is free software; you can redistribute it and/or modify it 280 | under the terms of the GNU General Public License as published by the Free 281 | Software Foundation; either version 2 of the License, or (at your option) 282 | any later version. 283 | 284 | This program is distributed in the hope that it will be useful, but WITHOUT 285 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 286 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 287 | more details. 288 | 289 | You should have received a copy of the GNU General Public License along 290 | with this program; if not, write to the Free Software Foundation, Inc., 291 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 292 | 293 | Also add information on how to contact you by electronic and paper mail. 294 | 295 | If the program is interactive, make it output a short notice like this when it 296 | starts in an interactive mode: 297 | 298 | Gnomovision version 69, Copyright (C) year name of author Gnomovision comes 299 | with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free 300 | software, and you are welcome to redistribute it under certain conditions; 301 | type 'show c' for details. 302 | 303 | The hypothetical commands 'show w' and 'show c' should show the appropriate 304 | parts of the General Public License. Of course, the commands you use may be 305 | called something other than 'show w' and 'show c'; they could even be 306 | mouse-clicks or menu items--whatever suits your program. 307 | 308 | You should also get your employer (if you work as a programmer) or your school, 309 | if any, to sign a "copyright disclaimer" for the program, if necessary. Here 310 | is a sample; alter the names: 311 | 312 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 313 | 'Gnomovision' (which makes passes at compilers) written by James Hacker. 314 | 315 | signature of Ty Coon, 1 April 1989 316 | 317 | Ty Coon, President of Vice 318 | 319 | This General Public License does not permit incorporating your program into 320 | proprietary programs. If your program is a subroutine library, you may 321 | consider it more useful to permit linking proprietary applications with the 322 | library. If this is what you want to do, use the GNU Library General Public 323 | License instead of this License. 324 | 325 | 326 | "CLASSPATH" EXCEPTION TO THE GPL 327 | 328 | Certain source files distributed by Oracle America and/or its affiliates are 329 | subject to the following clarification and special exception to the GPL, but 330 | only where Oracle has expressly included in the particular source file's header 331 | the words "Oracle designates this particular file as subject to the "Classpath" 332 | exception as provided by Oracle in the LICENSE file that accompanied this code." 333 | 334 | Linking this library statically or dynamically with other modules is making 335 | a combined work based on this library. Thus, the terms and conditions of 336 | the GNU General Public License cover the whole combination. 337 | 338 | As a special exception, the copyright holders of this library give you 339 | permission to link this library with independent modules to produce an 340 | executable, regardless of the license terms of these independent modules, 341 | and to copy and distribute the resulting executable under terms of your 342 | choice, provided that you also meet, for each linked independent module, 343 | the terms and conditions of the license of that module. An independent 344 | module is a module which is not derived from or based on this library. If 345 | you modify this library, you may extend this exception to your version of 346 | the library, but you are not obligated to do so. If you do not wish to do 347 | so, delete this exception statement from your version. 348 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![OpenJDK: Current JDK release and early-access builds](images/banner.svg) 2 | 3 | OpenJDK is the official reference implementation of the Java Platform, Standard Edition. This project builds [Snap packages](https://snapcraft.io/openjdk) of OpenJDK directly from its [source repositories](https://github.com/openjdk) on GitHub. These packages provide everything you need to develop a Java application on Linux, including all of the latest development tools, class libraries, API documentation, and source code of the Java Development Kit (JDK). 4 | 5 | ## Quick Setup 6 | 7 | Below are some quick setup instructions for developers who are familiar with the Linux command line. For complete instructions, see the [Usage](#usage) section later. 8 | 9 | ### Confined Usage 10 | 11 | Run the JDK tools from your Linux distribution: 12 | 13 | ```console 14 | $ java --version 15 | openjdk 21.0.7 2025-04-15 16 | OpenJDK Runtime Environment (build 21.0.7+6-Ubuntu-0ubuntu124.04) 17 | OpenJDK 64-Bit Server VM (build 21.0.7+6-Ubuntu-0ubuntu124.04, mixed mode, sharing) 18 | ``` 19 | 20 | Run the JDK tools from this Snap package in a stricty-confined environment: 21 | 22 | ```console 23 | $ openjdk.java --version 24 | openjdk 24.0.1 2025-04-15 25 | OpenJDK Runtime Environment (build 24.0.1+9-snap) 26 | OpenJDK 64-Bit Server VM (build 24.0.1+9-snap, mixed mode, sharing) 27 | ``` 28 | 29 | Set up the aliases and environment variables for the JDK tools from this Snap package: 30 | 31 | ```console 32 | $ source $(openjdk) 33 | $ java --version 34 | openjdk 24.0.1 2025-04-15 35 | OpenJDK Runtime Environment (build 24.0.1+9-snap) 36 | OpenJDK 64-Bit Server VM (build 24.0.1+9-snap, mixed mode, sharing) 37 | ``` 38 | 39 | ### Unconfined Usage 40 | 41 | Switch between the JDK tools from your Linux distribution and the JDK tools from this Snap package by setting the `JAVA_HOME` and `PATH` environment variables as shown below for Debian-based systems: 42 | 43 | ```console 44 | $ java --version 45 | openjdk 21.0.7 2025-04-15 46 | OpenJDK Runtime Environment (build 21.0.7+6-Ubuntu-0ubuntu124.04) 47 | OpenJDK 64-Bit Server VM (build 21.0.7+6-Ubuntu-0ubuntu124.04, mixed mode, sharing) 48 | 49 | $ export JAVA_HOME=/snap/openjdk/current/jdk 50 | $ $JAVA_HOME/bin/java --version 51 | openjdk 24.0.1 2025-04-15 52 | OpenJDK Runtime Environment (build 24.0.1+9-snap) 53 | OpenJDK 64-Bit Server VM (build 24.0.1+9-snap, mixed mode, sharing) 54 | 55 | $ export PATH=$JAVA_HOME/bin:$PATH 56 | $ java --version 57 | openjdk 24.0.1 2025-04-15 58 | OpenJDK Runtime Environment (build 24.0.1+9-snap) 59 | OpenJDK 64-Bit Server VM (build 24.0.1+9-snap, mixed mode, sharing) 60 | ``` 61 | 62 | For Fedora-based systems, see the [Usage](#usage) section later. 63 | 64 | ## Repository 65 | 66 | The branches of this repository publish the JDK general-availability release (GA) and early-access builds (EA) for the hardware platforms listed below. The table shows the Debian architecture, machine hardware name, and Java architecture of each build: 67 | 68 | | Debian | Machine | Java | JDK GA | JDK EA | 69 | |:-------:|:-------:|:-------:|:------:|:------:| 70 | | amd64 | x86_64 | amd64 | ✓ | ✓ | 71 | | arm64 | aarch64 | aarch64 | ✓ | ✓ | 72 | | armhf | armv7l | arm | ✓ | ✓ | 73 | | ppc64el | ppc64le | ppc64le | ✓ | ✓ | 74 | | s390x | s390x | s390x | ✓ | ✓ | 75 | 76 | The branches of this repository are named after the Snap channels where the builds are published: *edge*, *beta*, *candidate*, and *stable*. The HEAD branch is *edge*, and merges follow the Snap package releases from *edge* into *beta*, *beta* into *candidate*, and *candidate* into *stable*. 77 | 78 | ## See Also 79 | 80 | This project is one of four that I created to gain control of my development environment: 81 | 82 | * [OpenJDK](https://github.com/jgneff/openjdk) - Current JDK release and early-access builds 83 | 84 | [![openjdk](https://snapcraft.io/openjdk/badge.svg)](https://snapcraft.io/openjdk) 85 | 86 | * [OpenJFX](https://github.com/jgneff/openjfx) - Current JavaFX release and early-access builds 87 | 88 | [![openjfx](https://snapcraft.io/openjfx/badge.svg)](https://snapcraft.io/openjfx) 89 | 90 | * [Strictly Maven](https://github.com/jgneff/strictly-maven) - Apache Maven™ in a strictly-confined snap 91 | 92 | [![strictly-maven](https://snapcraft.io/strictly-maven/badge.svg)](https://snapcraft.io/strictly-maven) 93 | 94 | * [Strictly NetBeans](https://github.com/jgneff/strictly-netbeans) - Apache NetBeans® in a strictly-confined snap 95 | 96 | [![strictly-netbeans](https://snapcraft.io/strictly-netbeans/badge.svg)](https://snapcraft.io/strictly-netbeans) 97 | 98 | ## Schedule 99 | 100 | The table below contains the most recent schedule for OpenJDK. The channel columns show the JDK releases found on the channels during each phase of the schedule. 101 | 102 | | Date | Phase | Stable | Candidate | Beta | Edge | 103 | | ---------- | ------------------------- |:------:|:---------:|:----:|:----:| 104 | | 2025-03-18 | General Availability | 24 | ← | ← | 25 | 105 | | 2025-06-05 | Rampdown Phase One | 24 | ← | 25 | 26 | 106 | | 2025-07-17 | Rampdown Phase Two | 24 | ← | 25 | 26 | 107 | | 2025-08-07 | Initial Release Candidate | 24 | 25 | ← | 26 | 108 | | 2025-08-21 | Final Release Candidate | 24 | 25 | ← | 26 | 109 | | 2025-09-16 | General Availability | 25 | ← | ← | 26 | 110 | 111 | The leftwards arrow (←) indicates that the channel is closed. When a specific risk-level channel is closed, the Snap Store will select the package from the more conservative risk level in the column to its left. If the channel is re-opened, packages will once again be selected from the original channel. 112 | 113 | ## Installation 114 | 115 | Install the OpenJDK Snap package with the command: 116 | 117 | ```console 118 | $ sudo snap install openjdk 119 | ``` 120 | 121 | The Snap package is [strictly confined](https://snapcraft.io/docs/snap-confinement) and adds only the following interfaces to its permissions: 122 | 123 | * the [home interface](https://snapcraft.io/docs/home-interface) for the JDK tools to read and write files under your home directory, 124 | * the [desktop interfaces](https://snapcraft.io/docs/desktop-interfaces) for the Java launcher to run Java desktop applications, and 125 | * the [network interface](https://snapcraft.io/docs/network-interface) for the Java launcher to run Java network applications. 126 | 127 | Install the OpenJDK Snap package from a channel other than the *stable* channel with one of the following commands: 128 | 129 | ```console 130 | $ sudo snap install openjdk --candidate 131 | $ sudo snap install openjdk --beta 132 | $ sudo snap install openjdk --edge 133 | ``` 134 | 135 | ## Trust 136 | 137 | The steps in building the packages are open and transparent so that you can gain trust in the process that creates them instead of having to put all of your trust in their publisher. 138 | 139 | | Snap Channel | Build File | Source Code | Snap Package | 140 | | ------------ | ------------------- | ------------------- | ---------------------- | 141 | | candidate | [snapcraft.yaml][1] | [openjdk/jdk24u][4] | [openjdk-candidate][7] | 142 | | beta | [snapcraft.yaml][2] | [openjdk/jdk][5] | [openjdk-beta][8] | 143 | | edge | [snapcraft.yaml][3] | [openjdk/jdk][6] | [openjdk-edge][9] | 144 | 145 | [1]: https://github.com/jgneff/openjdk/blob/candidate/snap/snapcraft.yaml 146 | [2]: https://github.com/jgneff/openjdk/blob/beta/snap/snapcraft.yaml 147 | [3]: https://github.com/jgneff/openjdk/blob/edge/snap/snapcraft.yaml 148 | 149 | [4]: https://github.com/openjdk/jdk24u/tags 150 | [5]: https://github.com/openjdk/jdk/tags 151 | [6]: https://github.com/openjdk/jdk/tags 152 | 153 | [7]: https://launchpad.net/~jgneff/openjdk-snap/+snap/openjdk-candidate 154 | [8]: https://launchpad.net/~jgneff/openjdk-snap/+snap/openjdk-beta 155 | [9]: https://launchpad.net/~jgneff/openjdk-snap/+snap/openjdk-edge 156 | 157 | For each of the three channels, the table above links to: 158 | 159 | * the Snapcraft build file that creates the Snap package, 160 | * the release tags used to obtain the OpenJDK source code, and 161 | * information about the package and its latest builds on Launchpad. 162 | 163 | General-availability releases published to the *candidate* channel are eventually promoted to the *stable* channel. 164 | 165 | The [Launchpad build farm](https://launchpad.net/builders) runs each build in a transient container created from trusted images to ensure a clean and isolated build environment. Snap packages built on Launchpad include a manifest that lets you verify the build and identify its dependencies. 166 | 167 | ## Verify 168 | 169 | Each OpenJDK package provides a software bill of materials (SBOM) and a link to its build log. This information is contained in a file called `manifest.yaml` in the directory `/snap/openjdk/current/snap`. The `image-info` section of the manifest provides a link to the package's page on Launchpad with its build status, including the complete log file from the container that ran the build. You can use this information to verify that the OpenJDK Snap package installed on your system was built from source on Launchpad using only the software in [Ubuntu 20.04 LTS](https://cloud-images.ubuntu.com/focal/current/). 170 | 171 | For example, I'll demonstrate how I verify the OpenJDK Snap package installed on my system at the time of this writing. The `snap info` command shows that I installed OpenJDK version 24.0.1+9 with revision 2220, the revision for the *amd64* architecture: 172 | 173 | ```console 174 | $ snap info openjdk 175 | ... 176 | channels: 177 | latest/stable: 24.0.1+9 2025-04-16 (2220) 277MB - 178 | latest/candidate: ↑ 179 | latest/beta: ↑ 180 | latest/edge: 25+26 2025-06-06 (2259) 277MB - 181 | installed: 24.0.1+9 (2220) 277MB - 182 | ``` 183 | 184 | The following command prints the build information from the manifest file: 185 | 186 | ```console 187 | $ grep -A3 image-info /snap/openjdk/current/snap/manifest.yaml 188 | image-info: 189 | build-request-id: lp-97610881 190 | build-request-timestamp: '2025-04-15T18:42:57Z' 191 | build_url: https://launchpad.net/~jgneff/openjdk-snap/+snap/openjdk-candidate/+build/2780824 192 | ``` 193 | 194 | The `build_url` in the manifest is a link to the [page on Launchpad](https://launchpad.net/~jgneff/openjdk-snap/+snap/openjdk-candidate/+build/2780824) with the package's **Build status** and **Store status**. The store status shows that Launchpad uploaded revision 2220 to the Snap Store, which matches the revision installed on my system. The build status shows a link to the log file with the label [buildlog](https://launchpad.net/~jgneff/openjdk-snap/+snap/openjdk-candidate/+build/2780824/+files/buildlog_snap_ubuntu_bionic_amd64_openjdk-candidate_BUILDING.txt.gz). 195 | 196 | The end of the log file contains a line with the SHA512 checksum of the package just built, shown below with the checksum split to fit on this page: 197 | 198 | ``` 199 | Snapping... 200 | Snapped openjdk_24.0.1+9_amd64.snap 201 | Starting Snapcraft 7.5.8 202 | Logging execution to '/root/.local/state/snapcraft/log/snapcraft-20250415-190002.159578.log' 203 | 762ddc751db5ea7a25951ba63e147e1cde6caceb420df6bb686a8aaf6e45432c 204 | 4fbbe959a098bad53f68822649955bcf1a0007dd20b437b7cc90845ba3131d3d 205 | openjdk_24.0.1+9_amd64.snap 206 | Revoking proxy token... 207 | ``` 208 | 209 | The command below prints the checksum of the package installed on my system: 210 | 211 | ```console 212 | $ sudo sha512sum /var/lib/snapd/snaps/openjdk_2220.snap 213 | 762ddc751db5ea7a25951ba63e147e1cde6caceb420df6bb686a8aaf6e45432c 214 | 4fbbe959a098bad53f68822649955bcf1a0007dd20b437b7cc90845ba3131d3d 215 | /var/lib/snapd/snaps/openjdk_2220.snap 216 | ``` 217 | 218 | The two checksum strings are identical. Using this procedure, I verified that the OpenJDK Snap package installed on my system and the OpenJDK Snap package built and uploaded to the Snap Store by Launchpad are in fact the exact same package. For more information, see [Launchpad Bug #1979844](https://bugs.launchpad.net/launchpad/+bug/1979844), "Allow verifying that a snap recipe build corresponds to a store revision." 219 | 220 | ## Usage 221 | 222 | Once installed, the OpenJDK Snap package includes the following directories: 223 | 224 | * `/snap/openjdk/current/jdk` - Java Platform location 225 | * `/snap/openjdk/current/jdk/docs` - Javadoc API documentation 226 | * `/snap/openjdk/current/jdk/man` - Tool reference manuals 227 | * `/snap/openjdk/current/jdk/lib/src.zip` - Source code archive 228 | 229 | On Fedora-based systems, these directories are found under the root directory `/var/lib/snapd` as a prefix to the locations shown above for Debian-based systems. 230 | 231 | You can use the package in two ways: 232 | 233 | 1. as a confined set of programs that include all of their dependencies, or 234 | 2. as an unconfined suite of software forming a complete Java Platform. 235 | 236 | The first method should work on any Linux system, but the programs can access only non-hidden files owned by the user in the user's home directory. See the **Confined Usage** section below for details. 237 | 238 | The second method runs with traditional file access, but the programs require a system with Linux kernel version 3.2.0 or later and GNU C library version 2.29 or later. Those versions of the kernel and C library are found, for example, in Ubuntu 20.04 LTS, Fedora 30, or later releases. See the **Unconfined Usage** section below for details. 239 | 240 | ### Confined Usage 241 | 242 | When you run the OpenJDK commands with the prefix `openjdk`, the programs run strictly confined and use only the supporting libraries contained in the Snap package. The package defines the following commands for each of the corresponding JDK tools: 243 | 244 | - openjdk.java 245 | - openjdk.javac 246 | - openjdk.javadoc 247 | - openjdk.jar 248 | - openjdk.jarsigner 249 | - openjdk.jlink 250 | - openjdk.jwebserver 251 | 252 | The `openjdk` command itself prints the location of a file that defines environment variables and aliases which make it more convenient to use the OpenJDK Snap package: 253 | 254 | ```console 255 | $ openjdk 256 | /var/snap/openjdk/2220/openjdk.env 257 | ``` 258 | 259 | The file exports the `JAVA_HOME` and `MANPATH` environment variables, and it defines aliases for the JDK tools so that you can enter them without the package prefix: 260 | 261 | ```console 262 | $ cat $(openjdk) 263 | # Source this file for OpenJDK environment variables and aliases 264 | export JAVA_HOME=/snap/openjdk/2220/jdk 265 | export MANPATH=/snap/openjdk/2220/jdk/man: 266 | alias java='openjdk.java' 267 | alias javac='openjdk.javac' 268 | alias javadoc='openjdk.javadoc' 269 | alias jar='openjdk.jar' 270 | alias jarsigner='openjdk.jarsigner' 271 | alias jlink='openjdk.jlink' 272 | alias jwebserver='openjdk.jwebserver' 273 | ``` 274 | 275 | To set the environment variables and aliases in your current shell, use the `source` or "dot" (`.`) command to read and execute the commands from the file: 276 | 277 | ```console 278 | $ source $(openjdk) 279 | ``` 280 | 281 | You can then verify that `JAVA_HOME` and the aliases are defined with: 282 | 283 | ```console 284 | $ printenv | grep JAVA 285 | JAVA_HOME=/snap/openjdk/2220/jdk 286 | $ type java javac 287 | java is aliased to `openjdk.java' 288 | javac is aliased to `openjdk.javac' 289 | $ java --version 290 | openjdk 24.0.1 2025-04-15 291 | OpenJDK Runtime Environment (build 24.0.1+9-snap) 292 | OpenJDK 64-Bit Server VM (build 24.0.1+9-snap, mixed mode, sharing) 293 | 294 | ``` 295 | 296 | If you refer to locations outside of your home directory in the arguments to the Snap package commands or aliases, such as the JUnit libraries shown below, you'll see error messages like the following when compiling your program: 297 | 298 | ```console 299 | $ openjdk.javac -d build/testing --class-path \ 300 | /usr/share/java/junit4.jar:/usr/share/java/hamcrest-core-1.3.jar \ 301 | src/main/java/org/status6/hello/world/Hello.java \ 302 | src/test/java/org/status6/hello/world/HelloTest.java 303 | src/test/java/org/status6/hello/world/HelloTest.java:19: 304 | error: package org.junit does not exist 305 | import org.junit.Assert; 306 | ^ 307 | ``` 308 | 309 | You'll also see error messages like the following when running your program: 310 | 311 | ```console 312 | $ openjdk.java --class-path \ 313 | dist/hello-world-1.0.jar:/usr/share/java/junit4.jar:/usr/share/java/hamcrest-core-1.3.jar \ 314 | org.junit.runner.JUnitCore org.status6.hello.world.HelloTest 315 | Error: Could not find or load main class org.junit.runner.JUnitCore 316 | Caused by: java.lang.ClassNotFoundException: org.junit.runner.JUnitCore 317 | ``` 318 | 319 | In this case, copy the external libraries into your home directory to allow access, as in the example shown below: 320 | 321 | ```console 322 | $ openjdk.javac -d build/testing --class-path \ 323 | $HOME/lib/java/junit4.jar:$HOME/lib/java/hamcrest-core-1.3.jar \ 324 | src/main/java/org/status6/hello/world/Hello.java \ 325 | src/test/java/org/status6/hello/world/HelloTest.java 326 | ``` 327 | 328 | ### Unconfined Usage 329 | 330 | Build automation tools and integrated development environments (IDEs) usually require the location of a Java Platform, often with a corresponding `JAVA_HOME` environment variable. These tools invoke the JDK programs directly using their absolute paths on your system. 331 | 332 | When the programs are invoked directly, they run outside of their strictly-confined container and in your system's environment like any normal program. They have the same access to your system as the user account that runs them, and they depend on having their supporting libraries installed on your system. This is not how you're supposed to run a Snap package, but it works when the correct system dependencies are installed. 333 | 334 | Specifically, when invoked directly from their absolute paths, the commands in the OpenJDK Snap package require Linux kernel version 3.2.0 or later and GNU C library (glibc) version 2.29 or later. The following commands will show the versions of the kernel and C library on your system: 335 | 336 | ```console 337 | $ uname -r 338 | $ ldd --version 339 | ``` 340 | 341 | With the required kernel and C library, you can set the `JAVA_HOME` environment variable and run the programs directly. On Debian-based systems, define: 342 | 343 | ```console 344 | $ export JAVA_HOME=/snap/openjdk/current/jdk 345 | ``` 346 | 347 | On Fedora-based systems, define: 348 | 349 | ```console 350 | $ export JAVA_HOME=/var/lib/snapd/snap/openjdk/current/jdk 351 | ``` 352 | 353 | You can then run the programs directly from their installed locations: 354 | 355 | ```console 356 | $ $JAVA_HOME/bin/java --version 357 | openjdk 24.0.1 2025-04-15 358 | OpenJDK Runtime Environment (build 24.0.1+9-snap) 359 | OpenJDK 64-Bit Server VM (build 24.0.1+9-snap, mixed mode, sharing) 360 | ``` 361 | 362 | If your system has a version of the GNU C library older than 2.29, you'll see error messages similar to the example shown below, which ran on Ubuntu 18.04 LTS with glibc 2.27: 363 | 364 | ```console 365 | $ $JAVA_HOME/bin/java --version 366 | Error: dl failure on line 532 367 | Error: failed /snap/openjdk/2259/jdk/lib/server/libjvm.so, because 368 | /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found 369 | (required by /snap/openjdk/2259/jdk/lib/server/libjvm.so) 370 | ``` 371 | 372 | In this case, either upgrade your Linux system to a more recent version, or run the JDK tools using their Snap package commands or aliases as follows: 373 | 374 | ```console 375 | $ openjdk.java --version 376 | openjdk 24.0.1 2025-04-15 377 | OpenJDK Runtime Environment (build 24.0.1+9-snap) 378 | OpenJDK 64-Bit Server VM (build 24.0.1+9-snap, mixed mode, sharing) 379 | ``` 380 | 381 | Most desktop systems will include all of the packages needed to run the JDK tools, except for one: the `binutils` package required by `jlink`. The `jlink` program needs the `objcopy` command from `binutils` to create a custom run-time image. Without the extra package, you'll see an error message like the following: 382 | 383 | ```console 384 | $ $JAVA_HOME/bin/jlink ... 385 | Error: java.io.IOException: Cannot run program "objcopy": error=2, 386 | No such file or directory 387 | ``` 388 | 389 | Solve the error by installing the required package: 390 | 391 | ```console 392 | $ sudo apt install binutils 393 | ``` 394 | 395 | The following two sections compare the support on Ubuntu and Fedora Linux distributions for running the JDK programs confined in their Snap package or unconfined as a Java Platform. 396 | 397 | #### Ubuntu 398 | 399 | The table below shows the Snap package support for recent releases of Ubuntu: 400 | 401 | | Release | End of Updates | C Library | Confined | Unconfined | 402 | | --------- |:--------------:|:---------:|:--------:|:----------:| 403 | | 16.04 LTS | 2021-04-30 | 2.23 | ✓ | | 404 | | 18.04 LTS | 2023-05-31 | 2.27 | ✓ | | 405 | | 20.04 LTS | 2025-05-29 | 2.31 | ✓ | ✓ | 406 | | 22.04 LTS | 2027-06-01 | 2.35 | ✓ | ✓ | 407 | | 24.04 LTS | 2029-05-31 | 2.39 | ✓ | ✓ | 408 | 409 | #### Fedora 410 | 411 | The table below shows the Snap package support for recent releases of Fedora: 412 | 413 | | Release | End of Updates | C Library | Confined | Unconfined | 414 | |:-------:|:--------------:|:---------:|:--------:|:----------:| 415 | | 24 | 2017-08-08 | 2.23 | ✓ | | 416 | | 25 | 2017-12-12 | 2.24 | ✓ | | 417 | | 26 | 2018-05-29 | 2.25 | ✓ | | 418 | | 27 | 2018-11-30 | 2.26 | ✓ | | 419 | | 28 | 2019-05-28 | 2.27 | ✓ | | 420 | | 29 | 2019-11-26 | 2.28 | ✓ | | 421 | | 30 | 2020-05-26 | 2.29 | ✓ | ✓ | 422 | | 31 | 2020-11-24 | 2.30 | ✓ | ✓ | 423 | | 32 | 2021-05-25 | 2.31 | ✓ | ✓ | 424 | | 33 | 2021-11-30 | 2.32 | ✓ | ✓ | 425 | | 34 | 2022-06-07 | 2.33 | ✓ | ✓ | 426 | | 35 | 2022-12-13 | 2.34 | ✓ | ✓ | 427 | | 36 | 2023-05-16 | 2.35 | ✓ | ✓ | 428 | | 37 | 2023-12-05 | 2.36 | ✓ | ✓ | 429 | | 38 | 2024-05-21 | 2.37 | ✓ | ✓ | 430 | | 39 | 2024-11-26 | 2.38 | ✓ | ✓ | 431 | | 40 | 2025-05-13 | 2.39 | ✓ | ✓ | 432 | | 41 | 2025-11-19 | 2.40 | ✓ | ✓ | 433 | | 42 | 2026-05-13 | 2.41 | ✓ | ✓ | 434 | 435 | ## Build 436 | 437 | You can build the Snap package on Linux by installing [Snapcraft](https://snapcraft.io/snapcraft) on your development workstation. The `snap/snapcraft.yaml` files on the *candidate*, *beta*, and *edge* branches define the build for each channel. Run the following commands to install Snapcraft, clone this repository, and start building the package: 438 | 439 | ```console 440 | $ sudo snap install snapcraft --classic 441 | $ git clone https://github.com/jgneff/openjdk.git 442 | $ cd openjdk 443 | $ snapcraft 444 | ``` 445 | 446 | To run the build remotely on Launchpad, enter the command: 447 | 448 | ```console 449 | $ snapcraft remote-build 450 | ``` 451 | 452 | See the [Snapcraft Documentation](https://documentation.ubuntu.com/snapcraft/stable/) for more information about building Snap packages. 453 | 454 | ## License 455 | 456 | This project is licensed under the GNU General Public License v2.0 with the Classpath exception, the same license used by Oracle for the JDK project. See the files [LICENSE](LICENSE), [ADDITIONAL_LICENSE_INFO](ADDITIONAL_LICENSE_INFO), and [ASSEMBLY_EXCEPTION](ASSEMBLY_EXCEPTION) for details. 457 | 458 | Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates. See the file [TRADEMARK](TRADEMARK) for details. 459 | -------------------------------------------------------------------------------- /TRADEMARK: -------------------------------------------------------------------------------- 1 | OpenJDK Trademark Notice 2 | 3 | Version 1.21, 2017/12/19 4 | 5 | OpenJDK (the "Name") is a trademark of Oracle America, Inc. ("Oracle") 6 | (the "Trademark Owner"). 7 | 8 | Trademark Owner publishes source code (the "Original Software") at 9 | several World Wide Web locations (each a "Website"). These locations 10 | include: 11 | 12 | http://download.java.net/openjdk/jdk6 13 | http://download.java.net/openjdk/jdk7 14 | http://download.java.net/openjdk/jdk8 15 | http://hg.openjdk.java.net/jdk6 16 | http://hg.openjdk.java.net/jdk7 17 | http://hg.openjdk.java.net/jdk7u 18 | http://hg.openjdk.java.net/jdk8 19 | http://hg.openjdk.java.net/jdk8u 20 | http://hg.openjdk.java.net/jdk9 21 | http://hg.openjdk.java.net/jdk10 22 | http://hg.openjdk.java.net/jdk 23 | http://hg.openjdk.java.net/jdk-updates 24 | 25 | as well as any successor locations designated by Trademark Owner in 26 | future revisions of this Notice. 27 | 28 | Each Website provides Original Software in two parts: A Java virtual 29 | machine (the "Virtual Machine") and an API library and tools (the 30 | "Library and Tools"). 31 | 32 | Trademark Owner permits any person obtaining a copy of this software 33 | (the "Software") that is based on Original Software to use the Name in 34 | the package names and version strings of the Software subject to the 35 | following conditions: 36 | 37 | (1) The Software is a substantially complete implementation of the 38 | OpenJDK development kit or runtime environment source code 39 | retrieved from a single Website, and the vast majority of the 40 | Software code is identical to that upstream Original Software, 41 | except that: 42 | 43 | (a) Changes required to port Original Software to new operating 44 | systems or hardware architectures are permitted, so long as 45 | that work takes place in the context of an approved Project 46 | hosted in the OpenJDK Community; and 47 | 48 | (b) A Virtual Machine from one Website may be combined with the 49 | Library and Tools of another Website, so long as the vast 50 | majority of the code in each is identical to the 51 | corresponding upstream Virtual Machine or Library and Tools 52 | component. 53 | 54 | (2) No permission is hereby granted to use the Name in any other 55 | manner, unless such use constitutes "fair use", for example 56 | "based on the OpenJDK source code" or "DistroXYZ's packaging of 57 | the OpenJDK 6 code". 58 | 59 | (3) Trademark Owner makes no warranties of any kind respecting the 60 | Name, and all representations and warranties, including any implied 61 | warranty of merchantability, fitness for a particular purpose or 62 | non-infringement are hereby disclaimed. 63 | 64 | (4) Finally, this notice and the following legend are included in all 65 | copies of the Software or portions of it: 66 | 67 | Java and OpenJDK are trademarks or registered trademarks of 68 | Oracle and/or its affiliates. 69 | 70 | Trademark Owner intends to revise this Notice as necessary in order to 71 | meet the needs of the OpenJDK Community. Revisions to this notice will 72 | be announced on the public mailing list announce at openjdk.java.net, to 73 | which you may subscribe by visiting http://mail.openjdk.java.net. Please 74 | send questions or comments about this Notice to the discuss list at the 75 | same location. 76 | -------------------------------------------------------------------------------- /bin/envhook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Creates the environment file on installation and updates 3 | 4 | # Checks for required environment variables 5 | : "${SNAP:?}" 6 | : "${SNAP_INSTANCE_NAME:?}" 7 | : "${SNAP_DATA:?}" 8 | 9 | { 10 | printf "# Source this file for OpenJDK environment variables and aliases\n" 11 | printf "export JAVA_HOME=%s/jdk\n" "$SNAP" 12 | printf "export MANPATH=%s/jdk/man:\n" "$SNAP" 13 | printf "alias java='%s.java'\n" "$SNAP_INSTANCE_NAME" 14 | printf "alias javac='%s.javac'\n" "$SNAP_INSTANCE_NAME" 15 | printf "alias javadoc='%s.javadoc'\n" "$SNAP_INSTANCE_NAME" 16 | printf "alias jar='%s.jar'\n" "$SNAP_INSTANCE_NAME" 17 | printf "alias jarsigner='%s.jarsigner'\n" "$SNAP_INSTANCE_NAME" 18 | printf "alias jlink='%s.jlink'\n" "$SNAP_INSTANCE_NAME" 19 | printf "alias jwebserver='%s.jwebserver'\n" "$SNAP_INSTANCE_NAME" 20 | } > "$SNAP_DATA/openjdk.env" 21 | -------------------------------------------------------------------------------- /bin/openjdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Prints the path to the environment file 3 | printf "%s/openjdk.env\n" "${SNAP_DATA:?}" 4 | -------------------------------------------------------------------------------- /images/banner.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | John Neffenger 7 | 8 | OpenJDK Featured Banner 9 | True 10 | This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. 11 | 12 | 13 | 14 | 15 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | -------------------------------------------------------------------------------- /snap/hooks/install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Creates the environment file on initial installation 3 | "${SNAP:?}/bin/envhook.sh" 4 | -------------------------------------------------------------------------------- /snap/hooks/post-refresh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Creates the environment file after refresh updates 3 | "${SNAP:?}/bin/envhook.sh" 4 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | # snapcraft.yaml - builds a Snap package of OpenJDK 2 | # Copyright (C) 2020-2025 John Neffenger 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | name: openjdk 18 | title: OpenJDK 19 | summary: Current JDK release and early-access builds 20 | description: | 21 | OpenJDK is the official reference implementation of the Java 22 | Platform, Standard Edition, a cross-platform computing environment 23 | that lets you develop and deploy Java applications on desktops, 24 | servers, and embedded systems. 25 | 26 | This package provides everything you need to develop a Java 27 | application on Linux, including all of the latest development tools, 28 | class libraries, API documentation, and source code of the Java 29 | Development Kit (JDK). 30 | 31 | Installing this package does not replace the JDK provided by your 32 | Linux distribution but instead allows you to use both of them side by 33 | side. To get started, see the README file for this package on GitHub: 34 | 35 | https://github.com/jgneff/openjdk 36 | 37 | Java and OpenJDK are trademarks or registered trademarks of Oracle 38 | and/or its affiliates. 39 | 40 | adopt-info: jdk 41 | license: GPL-2.0-with-classpath-exception 42 | 43 | base: core20 44 | grade: devel 45 | confinement: strict 46 | 47 | architectures: 48 | - build-on: [amd64] 49 | - build-on: [arm64] 50 | - build-on: [armhf] 51 | - build-on: [ppc64el] 52 | - build-on: [riscv64] 53 | - build-on: [s390x] 54 | 55 | slots: 56 | jdk-25-2004: 57 | interface: content 58 | read: [$SNAP/jdk] 59 | jdk-26-2004: 60 | interface: content 61 | read: [$SNAP/jdk] 62 | 63 | plugs: 64 | home: null 65 | 66 | apps: 67 | openjdk: 68 | command: bin/openjdk.sh 69 | environment: 70 | LC_ALL: C.UTF-8 71 | java: 72 | command: jdk/bin/java 73 | plugs: 74 | # Adds the interfaces of the GNOME Snapcraft Extensions plus 'network' 75 | - desktop 76 | - desktop-legacy 77 | - gsettings 78 | - network 79 | - opengl 80 | - wayland 81 | - x11 82 | environment: 83 | LC_ALL: C.UTF-8 84 | javac: 85 | command: jdk/bin/javac 86 | environment: 87 | LC_ALL: C.UTF-8 88 | javadoc: 89 | command: jdk/bin/javadoc 90 | environment: 91 | LC_ALL: C.UTF-8 92 | jar: 93 | command: jdk/bin/jar 94 | environment: 95 | LC_ALL: C.UTF-8 96 | jarsigner: 97 | command: jdk/bin/jarsigner 98 | environment: 99 | LC_ALL: C.UTF-8 100 | jlink: 101 | command: jdk/bin/jlink 102 | environment: 103 | LC_ALL: C.UTF-8 104 | jwebserver: 105 | command: jdk/bin/jwebserver 106 | plugs: 107 | - network-bind 108 | environment: 109 | LC_ALL: C.UTF-8 110 | 111 | parts: 112 | bin: 113 | plugin: dump 114 | source: . 115 | source-type: local 116 | stage: [bin] 117 | 118 | jdk: 119 | plugin: autotools 120 | build-snaps: 121 | - openjdk/latest/stable 122 | build-packages: 123 | - curl 124 | - g++-10 125 | - git 126 | - graphviz 127 | - libasound2-dev 128 | - libcups2-dev 129 | - libfontconfig1-dev 130 | - libfreetype6-dev 131 | - libx11-dev 132 | - libxext-dev 133 | - libxrandr-dev 134 | - libxrender-dev 135 | - libxt-dev 136 | - libxtst-dev 137 | - pandoc 138 | - unzip 139 | - zip 140 | override-pull: | 141 | release=26 142 | gitrepo=https://github.com/openjdk/jdk.git 143 | tagfeed=https://github.com/openjdk/jdk/tags.atom 144 | 145 | # Gets the version from the latest release tag on GitHub 146 | # $1 = feature release number (formerly "major" version) 147 | # $2 = URL of the Atom web feed providing recent tags 148 | getversion() { 149 | local feature=$1 150 | local webfeed=$2 151 | curl -s "$webfeed" | grep "jdk-${feature}[.0-9]*+[^0]" \ 152 | | sed -E -e '1!d' -e 's| *<title>jdk-(.*)|\1|' 153 | } 154 | 155 | # Sets the version and saves its environment variable 156 | # $1 = the version string 157 | setversion() { 158 | snapcraftctl set-version "$1" 159 | printf "export SNAPCRAFT_PROJECT_VERSION=%s\n" "$1" \ 160 | > /tmp/snapcraft-project-version 161 | } 162 | 163 | # Sets the project version and clones the source repository by its tag 164 | version=$(getversion $release $tagfeed) 165 | setversion "$version" 166 | git clone --branch "jdk-$version" --depth 1 $gitrepo "$SNAPCRAFT_PART_SRC" 167 | build-environment: 168 | - JAVA_HOME: /snap/openjdk/current/jdk 169 | override-build: | 170 | # Upgrades to version 10 of gcc and g++ 171 | update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ 172 | --slave /usr/bin/g++ g++ /usr/bin/g++-10 173 | 174 | # Loads the version environment variable 175 | . /tmp/snapcraft-project-version 176 | 177 | # Sets the environment variable for reproducible builds 178 | SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) 179 | export SOURCE_DATE_EPOCH 180 | 181 | # Builds the JDK 182 | bash configure \ 183 | --enable-javac-server=no \ 184 | --with-vendor-name="Snap Build" \ 185 | --with-vendor-url="https://snapcraft.io/openjdk" \ 186 | --with-vendor-bug-url="https://github.com/jgneff/openjdk/issues" \ 187 | --with-version-pre=ea \ 188 | --with-version-opt=snap \ 189 | --with-version-build="${SNAPCRAFT_PROJECT_VERSION#*+}" \ 190 | --with-extra-cflags="$CFLAGS" \ 191 | --with-extra-cxxflags="$CXXFLAGS" \ 192 | --with-extra-ldflags="$LDFLAGS" \ 193 | --with-native-debug-symbols=none 194 | make images docs 195 | 196 | # Installs the build output 197 | cd build/linux-*-server-release/images || exit 198 | mv jdk docs "$SNAPCRAFT_PART_INSTALL" 199 | organize: 200 | docs: jdk/docs 201 | stage-packages: 202 | # Adds the 'jlink' dependency and all DejaVu fonts 203 | - binutils 204 | - fonts-dejavu-extra 205 | # Adds library packages suggested by Snapcraft plus 'libfontconfig1' 206 | - libasound2 207 | - libfontconfig1 208 | - libfreetype6 209 | - libpng16-16 210 | - libx11-6 211 | - libxau6 212 | - libxcb1 213 | - libxdmcp6 214 | - libxext6 215 | - libxi6 216 | - libxrender1 217 | - libxtst6 218 | 219 | del: 220 | after: [jdk] 221 | plugin: nil 222 | # Deletes files and links already available in the base snap 223 | override-prime: | 224 | cd "$SNAPCRAFT_PRIME" || exit 225 | base=/snap/core20/current 226 | for d in etc usr/lib usr/share; do 227 | find "$d" -type f -exec test -f "$base/{}" \; -delete 228 | find "$d" -type l -exec test -L "$base/{}" \; -delete 229 | done 230 | find ./* -type d -empty -exec test -d "$base/{}" \; -delete 231 | 232 | layout: 233 | # For Java Swing apps 234 | 235 | # Fontconfig error: Cannot load config file from /etc/fonts/fonts.conf 236 | /etc/fonts: 237 | bind: $SNAP/etc/fonts 238 | # Exception in thread "AWT-EventQueue-0" java.lang.InternalError: 239 | # java.lang.reflect.InvocationTargetException 240 | # Caused by: java.lang.NullPointerException: Cannot load from short array 241 | # because "sun.awt.FontConfiguration.head" is null 242 | /usr/share/fonts/truetype/dejavu: 243 | bind: $SNAP/usr/share/fonts/truetype/dejavu 244 | 245 | # For Raspberry Pi OS 246 | 247 | # ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' 248 | # from /etc/ld.so.preload cannot be preloaded (cannot open shared object 249 | # file): ignored. 250 | /etc/ld.so.preload: 251 | bind-file: $SNAP/etc/ld.so.preload 252 | --------------------------------------------------------------------------------