code icon indicating copy to clipboard operation
code copied to clipboard

JAVA_TOOL_OPTIONS environment is passed down to Java

Open brawaru opened this issue 1 year ago • 0 comments

Please confirm the following.

  • [X] I checked the existing issues for duplicate problems
  • [X] I have tried resolving the issue using the support portal
  • [X] I have ensured my Modrinth App installation is up to date

What version of the Modrinth App are you using?

0.8.7

What operating systems are you seeing the problem on?

Windows

Describe the bug

The app seems to pass down JAVA_TOOL_OPTIONS environment variable down when launching Java, which can cause issues similar to ones we had with _JAVA_OPTIONS environment variable when it has invalid values, like

  • being unable to complete installation of recommended Java because
  • being unable to install any modpack or create a new instance
  • Java tests failing
  • game not launching properly

Steps to reproduce

  1. Open command prompt.
  2. Execute SET JAVA_TOOL_OPTIONS=-XmxBananzaM -x:meowmeow.
  3. Drag Modrinth App executable into the window to insert its path and execute it as well.
  4. Test Java option in settings / Try installing recommended Java / Try creating a new modded instance.

(or otherwise define JAVA_TOOL_OPTIONS environment variable before launching Modrinth App and attempting step 4).

Expected behavior

The option is removed when Java is launched anywhere, similar to JAVA_OPTIONS, so it doesn't cause any issues.

Additional context

No response

brawaru avatar Sep 18 '24 17:09 brawaru