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

Process -XX arguments as JVM args #1112

Merged
merged 1 commit into from
Mar 30, 2018
Merged

Process -XX arguments as JVM args #1112

merged 1 commit into from
Mar 30, 2018

Conversation

longshorej
Copy link
Contributor

-XX... arguments now added to the JVM. Without this, the following fails:

javaOptions in Universal ++= Seq(
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseCGroupMemoryLimitForHeap"
)
Bad root server path: /opt/docker/-XX:+UnlockExperimentalVMOptions

@muuki88 muuki88 added the universal Zip, tar.gz, tgz and bash issues label Mar 23, 2018
@muuki88
Copy link
Contributor

muuki88 commented Mar 23, 2018

Thanks a lot for your pull request 😍

To make your example work you would have to prepend -J to the -XX parameters.

javaOptions in Universal ++= Seq(
  "-J-XX:+UnlockExperimentalVMOptions",
  "-J-XX:+UseCGroupMemoryLimitForHeap"
)

However my understanding is that this -J separation was introduced to allow
a separation between JVM and application arguments. The -XX arguments should
always be jvm args, so IMHO this pull request makes it a bit less confusing for new comers :)

Hint from the documentation: http://sbt-native-packager.readthedocs.io/en/latest/archetypes/java_app/customize.html#via-application-ini

@longshorej
Copy link
Contributor Author

Ah, thanks for that tip @muuki88, that works nicely.

@muuki88 muuki88 merged commit c770faa into sbt:master Mar 30, 2018
@guizmaii
Copy link
Contributor

guizmaii commented Apr 11, 2018

Hi,

I don't understand.
What's the difference between using the previously accepted format:

javaOptions in Universal ++= Seq(
  "-J-XX:+UnlockExperimentalVMOptions",
  "-J-XX:+UseCGroupMemoryLimitForHeap"
)

and the new one:

javaOptions in Universal ++= Seq(
  "-XX:+UnlockExperimentalVMOptions",
  "-XX:+UseCGroupMemoryLimitForHeap"
)

Where and why should I prefer the new one ?

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

Successfully merging this pull request may close these issues.

3 participants