When I open the Minecraft launcher and press play on the Java edition I get this message.
Failed to download file.
Name: oshi-core-6.2.2.jar
URL: https://libraries.minecraft.net/com/github/oshi/oshi-core/6.2.2/oshi-core-6.2.2.jar
Error details: Could not resolve host: libraries.minecraft.net
Filename on disk: oshi-core-6.2.2.jar
Path: C:\Users\farix\AppData\Roaming\.minecraft\libraries\com\github\oshi\oshi-core\6.2.2\oshi-core-6.2.2.jar
Exists: Nonexistent
If I press play again without closing the launcher I get this message.
Unable to locate the Java runtime.
Error details: 0x00000000 - system: The operation completed successfully.
Filename on disk: javaw.exe
Path: C:\Users\farix\AppData\Local\Packages\Microsoft.4297127D64EC6_8wekyb3d8bbwe\LocalCache\Local\runtime\java-runtime-gamma\windows-x64\java-runtime-gamma\bin\javaw.exe
Exists: Nonexistent
Linked issues
Comments

Thank you for your report!
We're tracking this issue in MCL-23025, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki