Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] The inability to install Java automatically on Mac OS. #106

Closed
TaigoStudio opened this issue Jun 8, 2024 · 9 comments
Closed

[BUG] The inability to install Java automatically on Mac OS. #106

TaigoStudio opened this issue Jun 8, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@TaigoStudio
Copy link
Contributor

TaigoStudio commented Jun 8, 2024

Describe the bug
The inability to install Java automatically on Mac OS.
During Java installation, the file installation path has jre.bundle/Contents/Home/ in it, which does not allow copying files to the runtimes folder

Environment (please complete the following information):

  • OS: MacOS ARM
  • CmlLib.Core Version: latest
  • .NET version: net8

Additional context
https://piston-meta.mojang.com/v1/packages/453682d6317aefaaada5e2a6ad2fe486c3aaa7ab/manifest.json

@TaigoStudio TaigoStudio added the bug Something isn't working label Jun 8, 2024
@TaigoStudio
Copy link
Contributor Author

Also, the manifest does not have Java 8 for Mac OS ARM, which does not allow you to run older versions. Is there anything we can do about it? Oracle has officially released a version for Mac OS ARM

@AlphaBs
Copy link
Member

AlphaBs commented Jun 8, 2024

I fixed this but not tested on mac yet. can you try the latest commit on dev branch?
56aba2d

@AlphaBs
Copy link
Member

AlphaBs commented Jun 8, 2024

you can specify JavaPath property of MLaunchOption when the library can't load a Java automatically.

@TaigoStudio
Copy link
Contributor Author

Снимок экрана 2024-06-08 в 17 54 07 It doesn’t work because this part has the installation path. If you remove it, everything will work

@TaigoStudio
Copy link
Contributor Author

Снимок экрана 2024-06-08 в 17 56 39 Here's the code that fixes it

@AlphaBs
Copy link
Member

AlphaBs commented Jun 8, 2024

Is it impossible to write a file into jre.bundle/Content/Home/? What error do you see? I don't understand what causes the error.

@AlphaBs
Copy link
Member

AlphaBs commented Jun 8, 2024

It is normal behavior to install files into <game>/runtime/<mac>/<java>/jre.bundle/Contents/Home/bin/java.

The new IJavaPathResolver implementation can resolve the right java binary path.

https://github.com/CmlLib/CmlLib.Core/blob/dev/src%2FJava%2FMinecraftJavaPathResolver.cs#L48-L62

@TaigoStudio
Copy link
Contributor Author

I didn't look to see if changing this class helped. I thought that the installation path was fixed there, so I didn't run minecraft completely. Tomorrow I'll see if Java works with the modified path

@TaigoStudio
Copy link
Contributor Author

yes, its fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants