Reputation: 91
I'm trying to run my gatling project in intelliJ using Java 8. I know that the VM option 'AggressiveOpts' is deprecated in Java 11 and removed in Java 12, but I was wondering why I am getting this error in Java 8?
I have updated my project SDK to be java 8 as well as updating my intelliJ boot runtime to also be Java 8 but this doesn't seem to work.
I have uninstalled Java and IntelliJ and clean installed them both again but that did not resolve the issue.
I have also tried using a different IDE which is VSC (Visual Studio Code) but I get the same errors as I did in intelliJ.
Unrecognized VM option 'AggressiveOpts'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
My current version of Java is 1.8.0_181
My current version of Gatling is 3.3.1
If it helps I am using gradle and the version is 4.8.1
Can anyone help resolve this issue?
Edit: Added build.gradle code
please see the build.gradle here: https://pastebin.com/MigH0Gxz
Upvotes: 9
Views: 15455
Reputation: 719159
If what you showed us was accurate (and we can't resolve the pastebin link anymore), you didn't mention AggressiveOpts
at all in the Gradle file.
I found an issue in the Gatling issue tracker that mentions this is a problem when you try to run Gatling on newer JVMs. The implication of the issue is that Gatling is supplying the JVM option itself.
However:
This implies that (despite what you say!) Gatling is actually using a later version of Java.
For what it is worth, the changeset that fixes this problem simply removes the unknown flag from the gatling.bat
and gatling.sh
files. You could find and check whichever of those files is relevant to your platform and remove the unsupported option by hand. Or you could try to figure out how Gatling is deciding which JVM to use.
Upvotes: 2
Reputation: 6608
The only possible explanation is that you have multiple JDK version installed on your machine and that gradle doesn't pick 1.8.0_181 but 12+ when creating the forked Gatling process. Do you have JAVA_HOME env var defined and where does it point to?
Upvotes: 3