User can specify JVM arguments for each SQ subprocess using properties sonar.web.javaOpts,sonar.web.javaAdditionalOpts, sonar.ce.javaOpts,sonar.ce.javaAdditionalOpts, sonar.search.javaOpts and/or sonar.search.javaAdditionalOpts.
Some JVM options are mandatory and always provided by SonarQube to start subprocesses (such as -Djava.io.tmpdir, -Djava.awt.headless=true, -Dfile.encoding=UTF-8 and many more options for the Elasticsearch subprocess).
Nothing prevents user from also specifying values for these mandatory options and this currently results in them being defined twice when passed to the subprocess.
Supported JVMs will apply the last option (at least, as of today). Options are passed to the JVM witht the user defined options last. This implies that user can modify options which are assumed by the system to be correct.
To improve this situation:
- mandatory options defined by user should be ignored
- a warning should be displayed listing all ignored options