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

Cannot set JVM flags via SBT_OPTS #377

Open
piotrp opened this issue Oct 5, 2023 · 0 comments
Open

Cannot set JVM flags via SBT_OPTS #377

piotrp opened this issue Oct 5, 2023 · 0 comments

Comments

@piotrp
Copy link

piotrp commented Oct 5, 2023

Wrapper incorrectly parses SBT_OPTS - behavior differs from sbt launcher.

Wrapper appends all arguments to sbt:

$ echo $SBT_OPTS
-Xmx4g

$ ./sbtwrapper -v
Using sbt options defined in variable $SBT_OPTS
No extra sbt options have been defined
[residual] arg = '-Xmx4g'
Detected sbt version 1.9.6
Using default jvm options
Detected Java version: 11
# Executing command line:
java
-Xms512m
-Xss2m
-XX:MaxInlineLevel=18
-XX:+UnlockExperimentalVMOptions
-XX:+UseJVMCICompiler
-jar
/c/Users/ppr/.sbt/launchers/1.9.6/sbt-launch.jar
-Xmx4g
...
[error] Expected symbol
[error] Not a valid command: -
[error] Expected end of input.
[error] Expected '--'
[error] Expected 'debug'
[error] Expected 'info'
[error] Expected 'warn'
[error] Expected 'error'
[error] Expected 'addPluginSbtFile'
[error] -Xmx4g
[error]  ^

sbt moves JVM arguments into correct spot:

$ echo $SBT_OPTS
-Xmx4g

$ sbt -v
[sbt_options] declare -a sbt_options=([0]="-Xmx4g")
[process_args] java_version = '11'
[copyRt] java9_rt = 'C:\Users\ppr\.sbt\1.0\java9-rt-ext-eclipse_adoptium_11_0_20/rt.jar'
# Executing command line:
java
-Dfile.encoding=UTF-8
-Dsbt.script=/c/sbt/bin/sbt
-Dscala.ext.dirs=C:\Users\ppr\.sbt\1.0\java9-rt-ext-eclipse_adoptium_11_0_20
-Djline.terminal=jline.UnixTerminal
-Dsbt.cygwin=true
-Xmx4g
-jar
C:\sbt\bin\sbt-launch.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant