├── .gitignore ├── .github ├── dependabot.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.md │ └── bug_report.md └── workflows │ ├── format-crash-report-in-issue-body.yml │ ├── minecraft-crash-reported-upstream-check.yml │ └── minecraft-crash.yml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── JOBS.md ├── README.md └── SECURITY.md /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | 3 | contact_links: 4 | - name: Minecraft Java Edition Related Issue 🔐 5 | url: https://bugs.mojang.com/projects/MC/summary 6 | about: Please submit Minecraft Java Edition related issues to the Mojang Issue Tracker First :-). 7 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context, screenshots or logs about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **Desktop (please complete the following information):** 14 | 15 | OS & version [e.g. Windows 10, 1822]: 16 | 17 | **MSFT Build of OpenJDK Version:** 18 | 19 | The output from `java --version` 20 | 21 | **To Reproduce:** 22 | Steps to reproduce the behavior: 23 | 24 | 1. Go to '...' 25 | 2. Click on '....' 26 | 3. Scroll down to '....' 27 | 4. See error 28 | 29 | **Expected behavior** 30 | A clear and concise description of what you expected to happen. 31 | 32 | **Screenshots, Logs etc** 33 | If applicable, add screenshots, logs to help explain your problem. 34 | 35 | **Additional context** 36 | Add any other context about the problem here. 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /JOBS.md: -------------------------------------------------------------------------------- 1 | # Java Engineering Group, Microsoft Developer Division 2 | 3 | Microsoft’s Developer Division (“DevDiv”) is chartered with empowering every developer and every development team on the planet to build great software faster, 4 | and that includes millions of Java developers worldwide. 5 | 6 | Within DevDiv, the Java Engineering Group is responsible for building best-in-class support for Java workloads running on Azure (Microsoft’s Cloud) and other 7 | products from the Microsoft family, such as Mojang’s Minecraft, LinkedIn, Yammer, and others. 8 | 9 | Our group actively works on the OpenJDK project, builds and ships the Microsoft Build of OpenJDK, tunes Java workloads at massive scale, builds insightful 10 | performance analysis and diagnostic tooling, and provides insights for internal and external developers to build more performant and cost-effective modern 11 | cloud native Java apps. 12 | 13 | We act as a liaison between Microsoft and the wider Java ecosystem and community, and as a member of this group, you will help build the best tooling 14 | experiences to make Microsoft tools and services loved by so many Java developers. 15 | 16 | Microsoft’s Java Engineering Group is looking for engineers, program managers and team leads interested in helping make the developer experience for Java 17 | working with Microsoft tools and services the best it can be. If you are interested in growing your engineering career, there is no better place to start! 18 | 19 | ## Open Positions 20 | 21 | No open positions at the moment. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Microsoft Build of OpenJDK 2 | 3 | To learn more about this distribution, visit [microsoft.com/openjdk](https://www.microsoft.com/openjdk). 4 | 5 | ## Releases 6 | 7 | Visit the [Downloads](https://aka.ms/msopenjdk-dl) page for the latest versions of the Microsoft Build of OpenJDK. 8 | 9 | ## Source Code 10 | 11 | The source code of our builds are hosted on the following repositories: 12 | 13 | 1. [microsoft/openjdk-jdk11u](https://github.com/microsoft/openjdk-jdk11u) 14 | 1. [microsoft/openjdk-jdk17u](https://github.com/microsoft/openjdk-jdk17u) 15 | 1. [microsoft/openjdk-jdk21u](https://github.com/microsoft/openjdk-jdk21u) 16 | 1. [microsoft/openjdk-jdk25u](https://github.com/microsoft/openjdk-jdk25u) 17 | 18 | The source code of our container images are hosted on the following repository: 19 | 20 | * [microsoft/openjdk-docker](https://github.com/microsoft/openjdk-docker) 21 | 22 | ## Contribute 23 | 24 | Feel free to open Issues in this repository, or any of the repositories above, as well as initiating conversations through GitHub Discussions. 25 | 26 | ## Jobs 27 | 28 | Looking for open jobs in the Microsoft Java Engineering Group? See [./JOBS.md](./JOBS.md). 29 | 30 | ## License 31 | 32 | MIT 33 | 34 | **Q:** Why is the license for this repo MIT as opposed to GPLv2+CE? 35 | 36 | **A:** Because *this* repo doesn't contain actual OpenJDK source code. We only use this repository for general issues, discussions and possibly GitHub Actions workflows. 37 | 38 | ## Feedback 39 | 40 | If you have any thoughts about our binaries, please [share them here](https://github.com/microsoft/openjdk/discussions). 41 | -------------------------------------------------------------------------------- /.github/workflows/format-crash-report-in-issue-body.yml: -------------------------------------------------------------------------------- 1 | # Format crash reports as code block which have been pasted into issue body without any formatting 2 | name: Format crash report in issue body 3 | on: 4 | issues: 5 | types: [opened] 6 | 7 | permissions: 8 | issues: write 9 | 10 | jobs: 11 | format-crash-report: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Format crash report 15 | uses: actions/github-script@v8 16 | with: 17 | script: | 18 | const issueNumber = context.issue.number 19 | const owner = context.repo.owner 20 | const repo = context.repo.repo 21 | const issueBody = (await github.rest.issues.get({ 22 | owner: owner, 23 | repo: repo, 24 | issue_number: issueNumber, 25 | })).data.body 26 | 27 | // Check if issue contains code block 28 | if (issueBody.includes('```')) { 29 | core.info('Issue body seems to contain code block; skipping formatting') 30 | return 31 | } 32 | 33 | // Matches the content of an unindented crash report 34 | const crashReportPattern = /^#(\r\n|\r|\n)^# A fatal error has been detected by the Java Runtime Environment:$.*^END\.$/ms 35 | const newIssueBody = issueBody.replace(crashReportPattern, '\n```\n$&\n```\n') 36 | 37 | if (newIssueBody === issueBody) { 38 | core.info('Did not find crash report in issue body') 39 | } else { 40 | core.notice('Found crash report in issue body, formatting it') 41 | github.rest.issues.update({ 42 | owner: owner, 43 | repo: repo, 44 | issue_number: issueNumber, 45 | body: newIssueBody, 46 | }) 47 | } 48 | -------------------------------------------------------------------------------- /.github/workflows/minecraft-crash-reported-upstream-check.yml: -------------------------------------------------------------------------------- 1 | name: Add Minecraft upstream label 2 | on: 3 | issue_comment: 4 | types: [created, edited] 5 | 6 | permissions: 7 | issues: write 8 | 9 | jobs: 10 | check-reported-upstream: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Check reported upstream 14 | # Ignore pull request comments, see 15 | # https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#issue_comment 16 | if: ${{ !github.event.issue.pull_request }} 17 | uses: actions/github-script@v8 18 | with: 19 | script: | 20 | // See documentation for payload properties 21 | // https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment 22 | const issue = context.payload.issue 23 | 24 | const sender = context.payload.sender.login 25 | 26 | if (issue.user.login !== sender) { 27 | core.info('Ignoring comment by user other than author') 28 | return 29 | } 30 | 31 | const reportedUpstreamLabel = 'Reported Upstream' 32 | const issueLabels = issue.labels.map(label => label.name) 33 | 34 | if (issueLabels.includes(reportedUpstreamLabel)) { 35 | core.info('Ignoring issue because it already has upstream label') 36 | return 37 | } 38 | if (!issueLabels.includes('Minecraft')) { 39 | core.info('Ignoring issue because it is not labeled as Minecraft') 40 | return 41 | } 42 | 43 | const commentBody = context.payload.comment.body 44 | // Check if comment mentions Mojira issue key, e.g. MC-123456, but not MC-123456 itself, 45 | // because it is in the instructions posted by the `minecraft-crash.yml` workflow and 46 | // can be quoted in comments 47 | const matchedMojiraIssueKey = /(? 2 | 3 | # Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /.github/workflows/minecraft-crash.yml: -------------------------------------------------------------------------------- 1 | name: Check Minecraft crash 2 | on: 3 | issues: 4 | types: [opened] 5 | 6 | permissions: 7 | issues: write 8 | 9 | jobs: 10 | check-minecraft-crash: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Check Minecraft crash 14 | uses: actions/github-script@v8 15 | with: 16 | script: | 17 | // Strings which indicate that Minecraft is modded 18 | const moddedStrings = [ 19 | 'net.fabricmc.loader.launch.knot.KnotClient', 20 | 'net.fabricmc.loader.impl.launch.knot.KnotClient', // new class name 21 | '--version fabric-loader-', 22 | '--tweakClass optifine.OptiFineTweaker', 23 | // Minecraft Forge 24 | '--launchTarget forgeclient', 25 | '--launchTarget fmlserver', 26 | '--fml.forgeVersion', 27 | ] 28 | 29 | async function httpGet(url) { 30 | const response = await fetch(url) 31 | const status = response.status 32 | const data = await response.text() 33 | if (status < 200 || status >= 300) { 34 | throw new Error(`GET request to ${url} failed with ${status} '${response.statusText}': ${data}`) 35 | } 36 | return data 37 | } 38 | 39 | const issueNumber = context.issue.number 40 | const owner = context.repo.owner 41 | const repo = context.repo.repo 42 | const issueData = (await github.rest.issues.get({ 43 | owner: owner, 44 | repo: repo, 45 | issue_number: issueNumber, 46 | })).data 47 | const issueTitle = issueData.title 48 | const issueBody = issueData.body 49 | 50 | // Uses negative lookbehind and lookahead to match start and end of string as well 51 | const minecraftRegex = /(? issueBody.includes(s)) 55 | if (foundModdedStrings.length === 0) { 56 | core.info('Did not find modded string in issue body, searching attachments') 57 | // Try searching in attachments 58 | // There is currently no API so try to find URL then get attachment content, see https://github.community/t/get-files-attached-in-issue/117443 59 | const attachmentPattern = new RegExp(`https://github\\.com/${owner}/${repo}/files/\\d+/[a-zA-Z0-9_\\-.]+`, 'g') 60 | const attachmentUrls = Array.from(issueBody.matchAll(attachmentPattern), m => m[0]) 61 | core.info(`Found attachment URLs: ${attachmentUrls}`) 62 | for (const url of attachmentUrls) { 63 | let attachment = undefined 64 | try { 65 | attachment = await httpGet(url) 66 | } catch (e) { 67 | // Only log message because complete error is rather verbose 68 | core.warning(`Failed getting attachment for ${url}: ${e.message}`) 69 | continue 70 | } 71 | 72 | if (!isMinecraftIssue) { 73 | isMinecraftIssue = minecraftRegex.test(attachment) 74 | if (isMinecraftIssue) { 75 | core.info('Found Minecraft string in attachment') 76 | } 77 | } 78 | 79 | moddedStrings.forEach(s => { 80 | if (attachment.includes(s)) { 81 | foundModdedStrings.push(s) 82 | } 83 | }) 84 | } 85 | } 86 | 87 | let isCrashFromModdedMinecraft = foundModdedStrings.length > 0 88 | 89 | if (isCrashFromModdedMinecraft) { 90 | core.notice(`Found modded strings: ${foundModdedStrings}`) 91 | } else { 92 | core.info('Did not find modded strings') 93 | } 94 | isMinecraftIssue = isMinecraftIssue || isCrashFromModdedMinecraft 95 | 96 | if (isMinecraftIssue) { 97 | core.notice('Detected issue to be about Minecraft') 98 | 99 | let commentBody 100 | if (isCrashFromModdedMinecraft) { 101 | // Don't tell user to report modded crashes on Mojang's bug tracker; they will most likely be considered Invalid 102 | commentBody = ( 103 | 'Thank you for the report!' 104 | + '\nIt looks like you are using a modified version of Minecraft. The following was detected in your crash report:' 105 | + '\n```' 106 | + '\n' + foundModdedStrings.join('\n') 107 | + '\n```' 108 | + '\nPlease try the following:' 109 | + '\n- Update your graphics drivers, see [this Minecraft Help Center article](https://help.minecraft.net/hc/en-us/articles/4409137348877-Minecraft-Java-Edition-Game-Crashes-and-Performance-Issues-FAQ), section "Update your Video Card Drivers";' 110 | + '\n often Minecraft crashes are caused by outdated graphics drivers' 111 | + '\n- Try disabling the mods you have installed one by one until you find the mod causing the crash, then report the crash to the mod author' 112 | + '\n- If you are using a third-party launcher, try the [official launcher](https://www.minecraft.net/download) instead' 113 | + '\n\nIf none of the above helped, and you are still experiencing the crash with the official launcher and without any mods installed, please submit this issue over at the [Mojang bug tracker](https://bugs.mojang.com/projects/MC/summary).' 114 | + ' Please search for existing reports first; in case you do not find any, create a new report and let us know about the issue number here (e.g. `MC-123456`).' 115 | + '\nThe Mojang team will take the first look. If an OpenJDK bug is identified, the Mojang team will contact the Microsoft Build of OpenJDK team to address the issue.' 116 | ) 117 | } else { 118 | commentBody = ( 119 | 'Thank you for the report!' 120 | + '\nIt looks like you are reporting that the game Minecraft crashed for you. Please try the following:' 121 | + '\n- Update your graphics drivers, see [this Minecraft Help Center article](https://help.minecraft.net/hc/en-us/articles/4409137348877-Minecraft-Java-Edition-Game-Crashes-and-Performance-Issues-FAQ), section "Update your Video Card Drivers";' 122 | + '\n often Minecraft crashes are caused by outdated graphics drivers' 123 | + '\n- In case you are using mods, try disabling them one by one until you find the mod causing the crash, then report the crash to the mod author' 124 | + '\n- If you are using a third-party launcher, try the [official launcher](https://www.minecraft.net/download) instead' 125 | + '\n\nIf none of the above helped, and you are still experiencing the crash with the official launcher and without any mods installed, please submit this issue over at the [Mojang bug tracker](https://bugs.mojang.com/projects/MC/summary).' 126 | + ' Please search for existing reports first; in case you do not find any, create a new report and let us know about the issue number here (e.g. `MC-123456`).' 127 | + '\nThe Mojang team will take the first look. If an OpenJDK bug is identified, the Mojang team will contact the Microsoft Build of OpenJDK team to address the issue.' 128 | ) 129 | } 130 | 131 | github.rest.issues.createComment({ 132 | owner: owner, 133 | repo: repo, 134 | issue_number: issueNumber, 135 | body: commentBody 136 | }) 137 | 138 | // Add Minecraft label 139 | github.rest.issues.addLabels({ 140 | owner: owner, 141 | repo: repo, 142 | issue_number: issueNumber, 143 | labels: ['Minecraft'] 144 | }) 145 | 146 | // We will close any Minecraft-related issue automatically 147 | github.rest.issues.update({ 148 | owner: owner, 149 | repo: repo, 150 | issue_number: issueNumber, 151 | state: 'closed' 152 | }) 153 | } 154 | --------------------------------------------------------------------------------