Bhavya
Bhavya

Reputation: 16192

Error : Unrecognized VM option 'AggressiveOpts'

I want to understand the inner workings of Elasticsearch, for that, I want to debug the Elasticsearch Source Code in IntelliJ IDEA.

I am following this and this to install and configure the code in Intellij.

Now, the next step was to Start Elasticsearch for debugging, for that I ran the following command in terminal

./gradlew :run

But, then I got the following error :

Unrecognized VM option 'AggressiveOpts' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

I followed several SO answers, but I am not able to resolve this issue.

Gradle version is 6.3 and Java version is 14

Edit 1: When I switched to java version 11, and ran the command ./gradlew :run

I get the error :

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':generateGlobalBuildInfo'.

    The compiler java.home must be set to a JDK installation directory for Java 13 but is [/home/bhavya/.jenv/versions/11] corresponding to [11]

enter image description here

Can anyone help me resolve this issue ?

Upvotes: 0

Views: 3788

Answers (1)

Juraj Martinka
Juraj Martinka

Reputation: 4368

You should identify where the AggressiveOpts option is coming from - I haven't found that in their repo on github: https://github.com/elastic/elasticsearch

This option has been removed from the recent JDK versions - see https://chriswhocodes.com/hotspot_options_jdk11.html -> there you'll see it was deprecated in JDK 12 and subsequently removed.

enter image description here

That's said, I'd be surprised if Elastic Search wouldn't support anything older than JDK 13 - if you want to run it with JDK 11 you should probably tell gradle so: How do I tell Gradle to use specific JDK version?

Upvotes: 1

Related Questions