Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use -J--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED in application.ini in Windows #1354

Closed
floating-cat opened this issue Jul 28, 2020 · 3 comments
Labels
universal Zip, tar.gz, tgz and bash issues

Comments

@floating-cat
Copy link

floating-cat commented Jul 28, 2020

I have a application.ini like this:

-J--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
-J-Xmx90m
-J-XX:MaxDirectMemorySize=90m

I use universal:packageBin to generate a zip for using in Windows & Linux.
I checked the documentation but can't find any way to add --add-opens=xxx, -XX:MaxDirectMemorySize=yy or similar java parameters in application.ini.

Actual behaviour

When I use xxx.bat with the above application.ini in the Windows, the xxx.bat will use "xxx\java.exe" --add-opens -Xmx90m -XX:MaxDirectMemorySize for running.
The "=java.base/jdk.internal.misc=ALL-UNNAMED" and "=90m" are all removed.
The xxx executable in Linux can run with that .ini file without any problem.

If I add " for these parameters (For example: "-J--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED") in .ini file, I can use it in the Windows, but it doesn't work in the Linux.

Expected behaviour

Can use --add-opens and -XX:MaxDirectMemorySize these JVM key-values parameters in application.ini in different OS.

Information

  • What sbt-native-packager are you using
    "com.typesafe.sbt" % "sbt-native-packager" % "1.7.3"
  • What sbt version
    1.3.10
  • What is your build system (e.g. Ubuntu, MacOS, Windows, Debian )
    Linux/Windows
  • What package are you building (e.g. docker, rpm, ...)
    universal:packageBin (Universal Plugin)
@muuki88 muuki88 added the universal Zip, tar.gz, tgz and bash issues label Jul 29, 2020
@muuki88
Copy link
Contributor

muuki88 commented Jul 29, 2020

Thanks for your report @floating-cat 😸

To be honest, I haven't used the application.ini feature in quite some time. Can you try configuring these parmeters via sbt as described here ?

@floating-cat
Copy link
Author

@muuki88 Thanks for the reply.

Currently, I use the batScriptConfigLocation for a Windows .ini file (use "-J--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED" in .ini file) and use the bashScriptConfigLocation for a Linux .ini file.(use -J--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED directly).

The two executable file (xxx.bat in Widnows vs xxx in Linux) parsing behaviors are different but using two different .ini could help here.
I tried to check the xxx.bat code to see whether I could create a PR to make the behaviors the same.
But the cmd scripts are so foreign to me so I gave up.

I am satisfied with my previously mentioned workaround so feel free to close this issue.

@muuki88
Copy link
Contributor

muuki88 commented Aug 3, 2020

Thanks for sharing ❤️

I have also no clue when it comes to windows bat files. I'm very happy about every PR that improves those, but I totally understand if it's just not doable for you. Thanks for trying 🙏 🥰

@muuki88 muuki88 closed this as completed Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
universal Zip, tar.gz, tgz and bash issues
Projects
None yet
Development

No branches or pull requests

2 participants