简体   繁体   English

无法识别的 VM 选项“AggressiveOpts”

[英]Unrecognized VM option 'AggressiveOpts'

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'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.我已将我的项目 SDK 更新为 java 8 并将我的 intelliJ 启动运行时更新为 Java 8 但这似乎不起作用。

I have uninstalled Java and IntelliJ and clean installed them both again but that did not resolve the issue.我已经卸载了 Java 和 IntelliJ 并再次干净地安装了它们,但这并没有解决问题。

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.我也尝试过使用不同的 IDE,它是 VSC(Visual Studio 代码),但我得到了与 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我当前版本的 Java 是 1.8.0_181

My current version of Gatling is 3.3.1我当前的 Gatling 版本是 3.3.1

If it helps I am using gradle and the version is 4.8.1如果有帮助,我正在使用 gradle 并且版本是 4.8.1

Can anyone help resolve this issue?任何人都可以帮助解决这个问题吗?

Edit: Added build.gradle code编辑:添加了 build.gradle 代码

please see the build.gradle here: https://pastebin.com/MigH0Gxz请在此处查看 build.gradle: https://pastebin.com/MigH0Gxz

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.唯一可能的解释是您的机器上安装了多个 JDK 版本,并且 gradle 在创建分叉的 Gatling 进程时没有选择 1.8.0_181 而是 12+。 Do you have JAVA_HOME env var defined and where does it point to?您是否定义了 JAVA_HOME env var,它指向哪里?

If what you have shown us is accurate, you don't mention AggressiveOpts at all in the Gradle file.如果您向我们展示的内容是准确的,那么您根本不会在 Gradle 文件中提及AggressiveOpts

I found an issue in the Gatling issue tracker that mentions this is a problem when you try to run Gatling on newer JVMs.我在 Gatling 问题跟踪器中发现了一个问题,当您尝试在较新的 JVM 上运行 Gatling 时,它提到这是一个问题。 The implication of the issue is that Gatling is supplying the JVM option itself.该问题的含义是 Gatling 正在提供 JVM 选项本身。

However:然而:

  • The issue was apparently fixed in Gatling 3.3.0 (see issue 3807 )该问题显然已在 Gatling 3.3.0 中得到解决(参见issue 3807
  • It should only affect you if Gatling is run using a Java 12+ JVM.只有在使用 Java 12+ JVM 运行 Gatling 时,它才会影响您。

The latter suggests that (despite what you say that you are running your Gradle build using Java 8) Gatling is actually using a later version of Java.后者表明(尽管您说您正在使用 Java 8 运行您的 Gradle 构建)加特林实际上使用的是 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.值得一提的是,修复此问题的变更集只是从gatling.batgatling.sh文件中删除了未知标志。 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.或者您可以尝试弄清楚 Gatling 如何决定使用哪个 JVM。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM