Home > Mobile >  Unrecognized VM option 'UseBiasedLocking' Error: Could not create the Java Virtual Machine
Unrecognized VM option 'UseBiasedLocking' Error: Could not create the Java Virtual Machine

Time:10-11

I was previously using Java 17 for creating and running tests in Gatling.

I wanted to run an old test suite written in Scala so I installed Scala using the Homebrew command:

brew install coursier/formulas/coursier && cs setup

Now when I attempt to run my Java suite it is giving these errors:

Unrecognized VM option 'UseBiasedLocking
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.854 s
[INFO] Finished at: 2022-10-11T12:54:17 01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:4.1.5:test (default-cli) on project performance-test-assignment-api: Gatling failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

"Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)"

Not sure why it is not compiling now since the current Java version is still 17

CodePudding user response:

I wanted to run an old test suite written in Scala so I installed Scala using the Homebrew command:

Why would you do that? You don't need to "install Scala", scala is just library that maven will pull.

brew install coursier/formulas/coursier && cs setup

This is installing coursier, unrelated.

io.gatling:gatling-maven-plugin:4.1.5

Your issue is here: you're using old gatling-maven-plugin 4.1.5. Upgrade to latest version (4.2.7 atm).

  • Related