Closed
Description
Using sbt 1.4.4 to create a zip for a Play Framework (2.8) project via sbt dist
.
I am specifying javaOptions
just like seen in the documentation. These are my exact settings:
javaOptions in Universal ++= Seq(
"-J-server",
"-Djava.awt.headless=true",
"-Dpidfile.path=/dev/null",
"-J-Xms576M",
"-J-Xmx576M",
"-J-XX:+AlwaysPreTouch",
"-J-XX:+UseStringDeduplication",
/* Begin G1GC Section */
"-J-XX:+UseG1GC",
"-J-XX:+UnlockExperimentalVMOptions",
"-J-XX:MaxGCPauseMillis=500",
"-J-XX:G1NewSizePercent=30",
"-J-XX:G1MaxNewSizePercent=80",
"-J-XX:+ParallelRefProcEnabled",
"-J-XX:InitiatingHeapOccupancyPercent=35"
/* End G1GC Section */
)
This creates an application.ini file as follows:
# options from build
-J-server
-Djava.awt.headless=true
-Dpidfile.path=/dev/null
-J-Xms576M
-J-Xmx576M
-J-XX:+AlwaysPreTouch
-J-XX:+UseStringDeduplication
-J-XX:+UseG1GC
-J-XX:+UnlockExperimentalVMOptions
-J-XX:MaxGCPauseMillis=500
-J-XX:G1NewSizePercent=30
-J-XX:G1MaxNewSizePercent=80
-J-XX:+ParallelRefProcEnabled
-J-XX:InitiatingHeapOccupancyPercent=35
This works fine on Mac and Linux, but results in "Improperly specified VM option 'MaxGCPauseMillis'" on Windows (with Java 8), when executing the .bat file in the bin folder.
Either of the following changes work for Windows, but do not work on Mac/Linux:
# options from build
-J-server
-Djava.awt.headless=true
-Dpidfile.path=/dev/null
-J-Xms576M
-J-Xmx576M
-J-XX:+AlwaysPreTouch
-J-XX:+UseStringDeduplication
-J-XX:+UseG1GC
-J-XX:+UnlockExperimentalVMOptions
"-J-XX:MaxGCPauseMillis=500"
"-J-XX:G1NewSizePercent=30"
"-J-XX:G1MaxNewSizePercent=80"
-J-XX:+ParallelRefProcEnabled
"-J-XX:InitiatingHeapOccupancyPercent=35"
# options from build
-J-server
-Djava.awt.headless=true
-Dpidfile.path=/dev/null
-J-Xms576M
-J-Xmx576M
-J-XX:+AlwaysPreTouch
-J-XX:+UseStringDeduplication
-J-XX:+UseG1GC
-J-XX:+UnlockExperimentalVMOptions
-J-XX:MaxGCPauseMillis=<500>
-J-XX:G1NewSizePercent=<30>
-J-XX:G1MaxNewSizePercent=<80>
-J-XX:+ParallelRefProcEnabled
-J-XX:InitiatingHeapOccupancyPercent=<35>
How do I set my javaOptions
in a way that works on both Mac/Linux and Windows?