ta-forever / downlords-taf-client

Lobby client forked from FAForever/downlords-faf-client
MIT License
6 stars 5 forks source link

Support Later Versions of Java #6

Closed tekktonic closed 2 years ago

tekktonic commented 2 years ago

Java 15 isn't a long term release and (at least in the case of OpenJDK) isn't supported at the moment. Adoption suggests that 16 and 17 are both still in-support but it might be better to only have a minimum check instead of version == 15

To Reproduce Steps to reproduce the behavior:

  1. Download the Linux version while on a currently-supported JDK (16 or 17)
  2. Try to run it
  3. Even though you're on a JVM >15 the runner will refuse to work because you're not exactly on Java 15.

Expected behavior The app works with modern Java versions.

OS Linux

Axle1975 commented 2 years ago

Removed javaMaxVersion from install4j https://github.com/ta-forever/downlords-taf-client/commit/4de3c7557f13df9979a33c3daf9a067b5dae2263

Rebuilt linux install package as pre-release 0.14.15: https://github.com/ta-forever/downlords-taf-client/releases/tag/v1.4.3-taf-0.14.15

exuvo commented 2 years ago

On linux with java-16-adoptopenjdk and v1.4.3-taf-0.14.13 (minor change to the startup script to allow 16) the program constantly fails to read the settings file and says it is corrupt. You can continue with reset settings. It writes new settings ok and the contents are correct. [JavaFX-Launcher] c.f.c.preferences.PreferencesService : Preferences file /home/exuvo/.taforever/client.prefs could not be read

When i use java 15 it works so it is not a permission issue.

The rest of the client seems to work okay. My friend on java 16 was able to join my game and play. We have not tested map downloads with java 16.

exuvo commented 2 years ago

On linux java-16-adoptopenjdk the reason the preferences are failing to load is that gson is trying to make java internal classes accessible by reflection which is not allowed in java 16+ by default.

Unable to make field private final java.lang.String java.net.HttpCookie.name accessible: module java.base does not "opens java.net" to unnamed module @c4437c4 due to Preferences: MapProperty<URI, ArrayList<HttpCookie>> storedCookies

The best solution is to add a custom TypeAdapter for java.net.HttpCookie.