Skip to content

gradle idea incorrectly fails with JAVA_HOME not set  #31399

Closed
@alpar-t

Description

@alpar-t

user @doubleuhy notes that:

gradle idea

Where:
Build file '/Users/zhouwuhong/elasticsearch/benchmarks/build.gradle' line: 31

What went wrong:
A problem occurred evaluating project ':benchmarks'.

Failed to apply plugin [id 'elasticsearch.build']
JAVA_HOME must be set to build Elasticsearch

but

echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home

I have seen this in the past, including on SO. I think what happens is that importing the project from idea without running ./gradlew idea first creates a daemon that is not restarted when running ./gradlew idea from the command line with the env var set despite there being a different env.

Running ./gradlew --stop makes the problem go away.

Metadata

Metadata

Assignees

Labels

:Delivery/BuildBuild or test infrastructureTeam:DeliveryMeta label for Delivery team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions