Mac Support

I didn't check what tatsu is doing in particular.

JavaFX has dedicated jars for Windows, Linux and Mac. Whether you took the Windows or the Linux release we provide, you are missing the JavaFX dependencies for Mac. The stacktrace indicates this as well. You would need a dedicated build for Mac. Not sure how tatsu worked around this.

"Nerds have a really complicated relationship with change: Change is awesome when WE'RE the ones doing it. As soon as change is coming from outside of us it becomes untrustworthy and it threatens what we think of is the familiar."
– Benno Rice

If you want mac support you should start the client from Intelij and make it has no issues if that works we can provide a built for mac

Soon™️

There is a video in the Read me that shows how to use the client via Intelij

Soon™️

@Brutus5000
Not sure if you had read, but he was referencing this original post on it: https://forums.faforever.com/viewtopic.php?f=2&t=16947#p169818 . Don't want to take up too much of your time but if you look at those instructions, do you think this would still work?

@axel12 are you saying just test to see if I can run the client from Intelij? I will start attempting this now and update you on my progress

Well I can built you can installer for mac but Ithink the client has bugs that make it unusable on mac. Those need to be resolved by someone on mac. Therefore you need to start it from Intelij and solve those. They are gonna be minor bugs. E.g. we have code that makes the icon blink but this code might not work on mac therefore would need to be wrapped in an

if(! isMac()){
    ...
}

Just as an example but we will only know what is bugged out on mac if somebody tries...

Soon™️

@axel12
Followed the Video in the readme to set up Intelij, and tried to run faf-client. Here is a majority of my output:

1:29:33 PM: Executing task 'Main.main() --stacktrace'...

Configure project :
Platform is: mac

Task :downloadIceAdapter UP-TO-DATE
Unable to get progress logger. Download progress will not be displayed.

Task :downloadUnixUid
Unable to get progress logger. Download progress will not be displayed.

Task :downloadWindowsUid UP-TO-DATE

Task :downloadNativeDependencies
Unable to get progress logger. Download progress will not be displayed.
Task :processResources UP-TO-DATE
Task :webview-patch:compileJava UP-TO-DATE
Task :webview-patch:processResources NO-SOURCE
Task :webview-patch:classes UP-TO-DATE
Task :webview-patch:jar UP-TO-DATE
Task :webview-patch:assemble UP-TO-DATE
Task :webview-patch:compileTestJava NO-SOURCE
Task :webview-patch:processTestResources NO-SOURCE
Task :webview-patch:testClasses UP-TO-DATE
Task :webview-patch:test NO-SOURCE
Task :webview-patch:check UP-TO-DATE
Task :webview-patch:build UP-TO-DATE
Task :compileJava UP-TO-DATE
Task :classes UP-TO-DATE

Task :Main.main()
13:29:35.280 [main] DEBUG com.faforever.client.preferences.PreferencesService - Logger initialized
2020-10-01 13:29:36.552 INFO 34270 --- [JavaFX-Launcher] o.s.boot.SpringApplication : Starting application on Nicholass-MBP.columbus.rr.com with PID 34270 (started by namore in /Users/namore/IdeaProjects/downlords-faf-client)
2020-10-01 13:29:36.554 INFO 34270 --- [JavaFX-Launcher] o.s.boot.SpringApplication : The following profiles are active: mac,prod
Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
2020-10-01 13:29:37.692 INFO 34270 --- [JavaFX-Launcher] trationDelegate$BeanPostProcessorChecker : Bean 'asyncConfig' of type [com.faforever.client.config.AsyncConfig$$EnhancerBySpringCGLIB$$6f7770ec] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-10-01 13:29:37.733 INFO 34270 --- [JavaFX-Launcher] trationDelegate$BeanPostProcessorChecker : Bean 'cacheConfig' of type [com.faforever.client.config.CacheConfig$$EnhancerBySpringCGLIB$$d0b62432] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.gson.internal.reflect.UnsafeReflectionAccessor (file:/Users/namore/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.5/f645ed69d595b24d4cf8b3fbb64cc505bede8829/gson-2.8.5.jar) to field java.net.HttpCookie.name
WARNING: Please consider reporting this to the maintainers of com.google.gson.internal.reflect.UnsafeReflectionAccessor
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2020-10-01 13:29:38.244 INFO 34270 --- [JavaFX-Launcher] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'taskScheduler'
Error in LSRegisterURL: -10811
2020-10-01 13:29:38.677 INFO 34270 --- [JavaFX-Launcher] c.f.c.map.generator.MapGeneratorService : Deleting leftover generated maps...
2020-10-01 13:29:38.682 WARN 34270 --- [JavaFX-Launcher] com.faforever.client.map.MapService : Could not load maps: installation path is not set
2020-10-01 13:29:38.707 INFO 34270 --- [JavaFX-Launcher] com.faforever.client.update.Version : The current application version is: snapshot
2020-10-01 13:29:38.710 INFO 34270 --- [JavaFX-Launcher] c.f.c.update.ClientUpdateServiceImpl : Current version: snapshot
2020-10-01 13:29:38.725 INFO 34270 --- [pool-3-thread-2] c.f.client.update.CheckForUpdateTask : Checking for client update
2020-10-01 13:29:38.789 WARN 34270 --- [JavaFX-Launcher] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileOpeningHandler' defined in file [/Users/namore/IdeaProjects/downlords-faf-client/build/classes/java/main/com/faforever/client/os/FileOpeningHandler.class]: Invocation of init method failed; nested exception is java.awt.HeadlessException
2020-10-01 13:29:38.790 WARN 34270 --- [JavaFX-Launcher] c.f.client.fa.relay.ice.IceAdapterImpl : Ignoring call to ICE adapter as we are not connected: quit([])
2020-10-01 13:29:38.794 INFO 34270 --- [JavaFX-Launcher] com.faforever.client.config.AsyncConfig : Shutting down ExecutorService 'taskExecutor'
2020-10-01 13:29:38.794 INFO 34270 --- [JavaFX-Launcher] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler'
2020-10-01 13:29:38.800 INFO 34270 --- [JavaFX-Launcher] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-10-01 13:29:38.811 ERROR 34270 --- [JavaFX-Launcher] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileOpeningHandler' defined in file [/Users/namore/IdeaProjects/downlords-faf-client/build/classes/java/main/com/faforever/client/os/FileOpeningHandler.class]: Invocation of init method failed; nested exception is java.awt.HeadlessException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:893)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)
at com.faforever.client.FafClientApplication.init(FafClientApplication.java:97)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:824)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.awt.HeadlessException: null
at java.desktop/java.awt.Desktop.getDesktop(Desktop.java:301)
at com.install4j.runtime.installer.helper.versionspecific.Java9Helper.setMacStartupListener(Java9Helper.java:30)
at com.install4j.runtime.installer.helper.versionspecific.VersionSpecificHelper.setMacStartupListener(VersionSpecificHelper.java:56)
at com.install4j.api.launcher.StartupNotification.registerStartupListener(StartupNotification.java:41)
at com.faforever.client.os.FileOpeningHandler.afterPropertiesSet(FileOpeningHandler.java:31)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
... 18 common frames omitted

Exception in Application init method
Exception in thread "main" java.lang.RuntimeException: Exception in Application init method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:895)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileOpeningHandler' defined in file [/Users/namore/IdeaProjects/downlords-faf-client/build/classes/java/main/com/faforever/client/os/FileOpeningHandler.class]: Invocation of init method failed; nested exception is java.awt.HeadlessException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:893)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)
at com.faforever.client.FafClientApplication.init(FafClientApplication.java:97)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:824)
... 2 more
Caused by: java.awt.HeadlessException
at java.desktop/java.awt.Desktop.getDesktop(Desktop.java:301)
at com.install4j.runtime.installer.helper.versionspecific.Java9Helper.setMacStartupListener(Java9Helper.java:30)
at com.install4j.runtime.installer.helper.versionspecific.VersionSpecificHelper.setMacStartupListener(VersionSpecificHelper.java:56)
at com.install4j.api.launcher.StartupNotification.registerStartupListener(StartupNotification.java:41)
at com.faforever.client.os.FileOpeningHandler.afterPropertiesSet(FileOpeningHandler.java:31)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
... 18 more

Gotta google what that means ...

Soon™️

@axel12
My misunderstanding then. I'm not sure I would have the capability to fix every bug to allow it to be run on a mac, given I have extremely limited developing experience.

Because you have a better understanding of the code, would you expect these to truly be easy fixes? - for example, adding those if blocks. If it's not stuff like that, I don't think I am the person to lead the rebuild.

We can try it. Me making changes and you copying the Exceptions 😄 and then use my code to fix them as long as they are easy fixes that is gonna work

Soon™️

https://drive.google.com/file/d/1JiMZDQNEEsQoK-n23QsyNb0X4v41n4l4/view?usp=sharing

Checkout the feature/mac-support branch and try again I should have fixed the Exception above but there are sure gonna be more.

Soon™️

java version 14 on mac too I imagine?
your video doesn't play for me.

https://github.com/FAForever/downlords-faf-client/issues/1972

Now how likely is it to be able to run faf on an m1 mac?

I don't have one yet, but that would be pretty sweet.

But given that it seems like it is no easy feat to get it to work even on intel macs I assume it might be a long shot 😛

Let's see:

  • Apple dropped support for OpenGL long ago and skipped Vulkan (required to emulate DirectX)
  • Apple somehow disclosed device details so that Linux support since 2017 is reduced to basic features
  • different CPU architecture will cause huge overhead on emulating x86.

Apple works hard for years to keep Linux developers out of their ecosystem. But Wine and Proton are primarily Linux applications. Maybe some hardcore fanboys try to support it, but it will never reach the compatibility again it once had.

"Nerds have a really complicated relationship with change: Change is awesome when WE'RE the ones doing it. As soon as change is coming from outside of us it becomes untrustworthy and it threatens what we think of is the familiar."
– Benno Rice