0

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.

  • I have cloned the main Elasticsearch code repository to my local machine.

  • Then, I imported Elasticsearch into an IntelliJ IDEA project. IntelliJ IDEA starts building the source code, and after some time build is completed and is successful.

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 ?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
ESCoder
  • 15,431
  • 2
  • 19
  • 42

1 Answers1

1

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?

Juraj Martinka
  • 3,991
  • 2
  • 23
  • 25
  • 1
    thanks for your answer, but even after setting ```org.gradle.java.home=/home/bhavya/.jenv/versions/11``` and ```JAVA_HOME``` is also pointing to same path i.e ```/home/bhavya/.jenv/versions/11```, still, I am getting the same error as mentioned in **Edit 1** – ESCoder Jun 22 '20 at 05:01