magefree / mage

Magic Another Game Engine
http://xmage.today
MIT License
1.91k stars 777 forks source link

Run client/server under any java version and play on public servers (macOS M1/2/3 fix and other) #12768

Open JayDi85 opened 2 months ago

JayDi85 commented 2 months ago

For macOS users: current releases are fully compatible and haven't any freezes anymore, so you don't need to use java replacement

Current public servers works under java 8 and it's incompatible with java 9+ clients by default.

On server connection it will show errors like:

There is possible a solution to run compatible client under any java version. It can be usefull for macOS with M1/2/3 machines who can't run java 8 due constant freeze (#12431). Added: not actual anymore cause macOS freezes fixed with non-blocking in last release #12825

Instruction:

  1. Download and install current client from http://xmage.today/ (follow site instructions);
  2. Run launcher and press update button - it will download java and other files;
  3. Open launcher's "settings -> java -> client options" and add that additional params to the end (keep spaces too):
    • --add-opens=java.base/java.io=ALL-UNNAMED
    • shot_240831_211810
  4. Find and download latest OpenJDK version from any sites like https://adoptium.net/temurin/releases/
    • use stable/lts version first like java 17 or 21;
    • if nothing helps then use java 24 from here;
  5. Extract java files to temp folder and copy that files to xmage's "launcher\java\jre1.8.0_201" folder -- make sure you keep same files structure;
  6. Now run client from a launcher again and play on any public servers;
  7. Warning, if you see pixelated images, icons and text then must disabled Windows's DPI-aware feature or add the follow additional launcher param for java - client:
    • -Dsun.java2d.uiScale=1.0
JayDi85 commented 2 months ago

If you see pixelated images, icons and text then must disabled Windows's DPI-aware feature or add the follow additional launcher param for settings - java - client:

JayDi85 commented 2 months ago

Recommended java versions for maximum client-server compatibility (read "java 21" as any java 9+):

P.S. Look at starting comment for add-opens and uiScale params usage.