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

Issue running on Mac OSX Monterrey with M1 processors #7826

Closed
MRigal opened this issue Sep 19, 2022 · 6 comments
Closed

Issue running on Mac OSX Monterrey with M1 processors #7826

MRigal opened this issue Sep 19, 2022 · 6 comments
Labels

Comments

@MRigal
Copy link
Contributor

MRigal commented Sep 19, 2022

Platform
Mac OSX Monterrey (12.4), with Apple Silicon M1 Pro processor

Version
Tried with 4.1.18 and with 4.2.10

Describe the bug
The game is impossible to start.

To Reproduce
Steps to reproduce the behavior:

  1. Install java bia brew install java[@11]
  2. Download Unciv.jar
  3. Run the command specified at https://yairm210.github.io/Unciv/Other/Installing-on-macOS/
  4. See error

Please note that the behaviour is the same with OpenJDK 18 and 11. I've also tried without the headless option, also without success. Please note that I had it working on an older, Intel-based Mac with openjdk11, see #2551

$ /opt/homebrew/opt/openjdk/bin/java --version
openjdk 18.0.2.1 2022-08-18
OpenJDK Runtime Environment Homebrew (build 18.0.2.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 18.0.2.1+0, mixed mode, sharing)
$ /opt/homebrew/opt/openjdk/bin/java -XstartOnFirstThread -Djava.awt.headless=true -jar Unciv.jar
Exception in thread "main" java.awt.HeadlessException
	at java.desktop/sun.awt.HeadlessToolkit.getScreenSize(HeadlessToolkit.java:186)
	at com.unciv.app.desktop.DesktopLauncher.main(DesktopLauncher.kt:55)
$ /opt/homebrew/opt/openjdk/bin/java -XstartOnFirstThread  -jar Unciv.jar
zsh: trace trap  /opt/homebrew/opt/openjdk/bin/java -XstartOnFirstThread -jar Unciv.jar

Expected behavior
I thought the jar could be used also this way on Mac OSX. I haven't tried yet to compile it.

@yairm210
Copy link
Owner

Oh shoot
That error specifically looks like it may have to do with the screen resize code?
Can I bother you too check 4.2.9?

@yairm210
Copy link
Owner

Also you shouldn't need the -XStartoffirstthread anymore, try running without that? Just a hunch, maybe that's what makes it 'hesdless' and makes the java toolkit not recognize the screen size

@MRigal
Copy link
Contributor Author

MRigal commented Sep 19, 2022

Also you shouldn't need the -XStartoffirstthread anymore, try running without that? Just a hunch, maybe that's what makes it 'hesdless' and makes the java toolkit not recognize the screen size

Unfortunately not... :-/

$ /opt/homebrew/opt/openjdk/bin/java -Djava.awt.headless=true -jar Unciv.jar
Exception in thread "main" java.awt.HeadlessException
	at java.desktop/sun.awt.HeadlessToolkit.getScreenSize(HeadlessToolkit.java:186)
	at com.unciv.app.desktop.DesktopLauncher.main(DesktopLauncher.kt:55)

@MRigal
Copy link
Contributor Author

MRigal commented Sep 19, 2022

But lol /opt/homebrew/opt/openjdk/bin/java -jar Unciv.jar just works :-D

It actually works well both with openjdk 11 and openjdk 18. So I think you just need to update the docs for Mac OSX installation :-)

Thanks @yairm210 !!! 💯

@nacro711072
Copy link
Contributor

nacro711072 commented Sep 20, 2022

i will update relative doc.

@MRigal
Copy link
Contributor Author

MRigal commented Sep 20, 2022

Fixed by @nacro711072 in the docs with #7828 :-)

@MRigal MRigal closed this as completed Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants