FAForever / downlords-faf-client

Official client for Forged Alliance Forever
https://faforever.com
MIT License
196 stars 121 forks source link

guide for linux runner #984

Closed tatsujb closed 5 years ago

tatsujb commented 6 years ago

hi!

the default parameter : "%s" is the wrong one . I was told at one point what it was now I can't remember.

I remember I had been told this by somebody on the Downlord-FAF team and it was something like "%w" (this isn't it though, I tried) and it worked amazingly well it just linked to the game.

but right now I can't remember what the args were.

I'm using lutris because that works now on ubuntu 18 whereas wine doesn't. it uses wine all the same but it's own wineprefix & configuration that for some reason just works.

here's my current setup :

Game Location : /home/t/.local/share/lutris/runners/winesteam/prefix64/drive_c/Program Files (x86)/Steam/steamapps/common/Supreme Commander Forged Alliance

command line for executable : "%s"

Execution directory : "/opt/downlords-faf-client-0.9.0-beta-rc.3"

(which is apparently the default since I am running faf after cd'ing to this directory)

the error I get is the following which doesn't really add up : screenshot from 2018-10-06 12-27-34

i allowed the executing of the exe btw

java.util.concurrent.CompletionException: com.github.nocatch.NoCatchException: java.io.IOException: Cannot run program "/home/t/.faforever/bin/ForgedAlliance.exe" (in directory ""): error=2, No such file or directory
    at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
    at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
    at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:659)
    at java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:669)
    at java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:1997)
    at com.faforever.client.game.GameService.startGame(GameService.java:464)
    at com.faforever.client.game.GameService.lambda$hostGame$9(GameService.java:228)
    at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656)
    at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:632)
    at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
    at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
    at com.faforever.client.remote.FafServerAccessorImpl.onGameLaunchInfo(FafServerAccessorImpl.java:505)
    at com.faforever.client.remote.FafServerAccessorImpl.lambda$parseServerObject$1(FafServerAccessorImpl.java:447)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at com.faforever.client.remote.FafServerAccessorImpl.parseServerObject(FafServerAccessorImpl.java:447)
    at com.faforever.client.remote.FafServerAccessorImpl.onServerMessage(FafServerAccessorImpl.java:416)
    at com.faforever.client.remote.AbstractServerAccessor.blockingReadServer(AbstractServerAccessor.java:44)
    at com.faforever.client.remote.FafServerAccessorImpl$1.call(FafServerAccessorImpl.java:260)
    at com.faforever.client.remote.FafServerAccessorImpl$1.call(FafServerAccessorImpl.java:232)
    at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at javafx.concurrent.Service.lambda$null$493(Service.java:725)
    at java.security.AccessController.doPrivileged(Native Method)
    at javafx.concurrent.Service.lambda$executeTask$494(Service.java:724)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: com.github.nocatch.NoCatchException: java.io.IOException: Cannot run program "/home/t/.faforever/bin/ForgedAlliance.exe" (in directory ""): error=2, No such file or directory
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.github.nocatch.NoCatch.wrapException(NoCatch.java:61)
    at com.github.nocatch.NoCatch.noCatch(NoCatch.java:104)
    at com.github.nocatch.NoCatch.noCatch(NoCatch.java:82)
    at com.faforever.client.game.GameService.lambda$startGame$34(GameService.java:472)
    at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656)
    ... 24 more
Caused by: java.io.IOException: Cannot run program "/home/t/.faforever/bin/ForgedAlliance.exe" (in directory ""): error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at com.faforever.client.fa.ForgedAllianceService.launch(ForgedAllianceService.java:124)
    at com.faforever.client.fa.ForgedAllianceService.startGame(ForgedAllianceService.java:74)
    at com.faforever.client.game.GameService.lambda$null$33(GameService.java:472)
    at com.github.nocatch.NoCatch.noCatch(NoCatch.java:100)
    ... 27 more
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 31 more

I've tried setting the Execution directory : to /

but in that situation FAF has a progress bar that instantly goes away with nothing happening and no error message so I think it's worse.

1-alex98 commented 6 years ago

We planned on making a linux executable but we have not many linux developers that are willing to fix issues on linux

Brutus5000 commented 6 years ago

I set it up for dragonite today on Ubuntu. We needed to give file permissions to the downloaded ForgedAlliance.exe and use wine "%s" as the command line. That was enough to run it from IntelliJ. But we were using oracle jdk 10.

tatsujb commented 6 years ago

yeah I figured it out it was kinda like brutus said. I'll post a video of how I did it

tatsujb commented 6 years ago

https://youtu.be/ruLJ_4SWI14

1-alex98 commented 5 years ago

We would add it to the read me if you would do this with the newest version and not some unofficial version

tatsujb commented 5 years ago

i'm on it

1-alex98 commented 5 years ago

Also the newest versions are in tar.gz that might be a little different to install (not sure)

tatsujb commented 5 years ago

heck yeah it will. it's less reliable then .deb. I can work with it anyways but my audience (whatever that is) won't enjoy the downgrade. here's crossing fingers for a .deb as part of releases one day :)

1-alex98 commented 5 years ago

We can probably add that to future releases again, but that is rather a task for @micheljung i am not that much into that

tatsujb commented 5 years ago

.run would be best as it works on absolutely any linux distro.

tatsujb commented 5 years ago

so far can't get it to work

No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be 10.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

why is there no flexibility here?

I uninstalled 8 and went to install 10 but the team packaging it skipped straight to 11 so those are kinda my two only options here (8/9 and 11).

I tried with both.

from what I understand java 10 code shouldn't be too deprecated by java 11 standards so running java 10 code with a java 11 runtime should work fine?

I don't understand why downlord FAF could be neither up or down compatible? how is that even possible?

surely a config file has a wrong parameter pre-build?

1-alex98 commented 5 years ago

U need 10 you shall NOT USE java 11

1-alex98 commented 5 years ago

Install open jre 10 should work

1-alex98 commented 5 years ago

Did you set INSTALL4J_JAVA_HOME ?

tatsujb commented 5 years ago

https://askubuntu.com/questions/1095910/force-oracle-java-10-not-java-11?noredirect=1#comment1804922_1095910

Did you set INSTALL4J_JAVA_HOME ?

yes

Install open jre 10 should work

had issues

ok nevermind i figured it out the trick to forcing open jdk 10 is to uninstall, remove both webup and uprising repos and then add the uprising repos again and download the open jre 10 from that.

I'll update to say if it ran downlord faf

edit nope nevermind. that just defaults to oracle jdk 11 AGAIN

heelix commented 5 years ago

First off - you guys are doing amazing work. I've been lurking for some time and watching the code. I'll be trying to get this working on steamos and centos, so another Linux guy jumping into the fray.

Why JDK 10 rather than 11? In the process of getting from JDK 8 to 11(LTS) at work, which has been all sorts of fun.

On Sun, Nov 25, 2018 at 9:36 AM tatsujb notifications@github.com wrote:

https://askubuntu.com/questions/1095910/force-oracle-java-10-not-java-11?noredirect=1#comment1804922_1095910

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FAForever/downlords-faf-client/issues/984#issuecomment-441449250, or mute the thread https://github.com/notifications/unsubscribe-auth/ACAzTFegG8swHYrUlTBCNMrk1l4IYP6cks5uyrj9gaJpZM4XLSZS .

Brutus5000 commented 5 years ago

Because making the release was more important right now than spend more time on migrating to JDK11. The timespan between 0.8 and 0.9 was over a year which introduced a lot of issues due to changes and regressions piling up.

heelix commented 5 years ago

Yah, figured as much. Fire and motion. Wish our work code was as clean as this 'play' code. :)

1-alex98 commented 5 years ago

And java 11 has no java fx anymore u need to add it as dependency i think

tatsujb commented 5 years ago

what? that's a crazy move on their part! is adding java fx as a dependency a pain?

1-alex98 commented 5 years ago

Not really also it makes java fx independent from java releases

iicurtis commented 5 years ago

I like the tar.gz honestly. I think it's easier for anyone not strictly on Ubuntu, but we can all do the extra work to extract it and install it to the correct places.

My notes: After extracting and setting INSTALL4J_JAVA_HOME, I still had one more step to make:

chmod +x ~/.faforever/bin/*.exe

tatsujb commented 5 years ago

it's more DIY then people are used to. ubuntu and linux distros in general have shed their "hard to use" nowadays you can use ubuntu even if you identify as a gamer and nothing else or even if you identify as a "grandma" and have more ease of use then windows by a huge margin.

People are switching to linux thanks to this and I'd like to encourage this movement by making faf one of those "plug-and-play" things on linux.

tatsujb commented 5 years ago

I got faf running from tarball by successfully forcing an install of java 10.

however the maintainer of wine-gallium nine broke compatibility with ubuntu 18.04.01 with his update to 3.20 so I'm kinda stuck.

tatsujb commented 5 years ago

sorry to have taken so long : https://www.youtube.com/watch?v=RRINgZQl7LU

1-alex98 commented 5 years ago

https://github.com/FAForever/downlords-faf-client/wiki/Install-on-Linux

tatsujb commented 5 years ago

@axel1200 new one up : https://www.youtube.com/watch?v=4B6EsXtL8C0

tatsujb commented 5 years ago

@axel1200 hey could we have that link updated to simply my script? https://github.com/tatsujb/installFAFscript that video has been outdated for a good while yet it's been getting a good number of views from that page.

1-alex98 commented 5 years ago

@tatsujb added to the readme as well