Search code examples
intellij-ideabuildrjava-home

Buildr doesn't find JAVA_HOME from Intellij


I have Buildr installed on Ubuntu and it works fine running from command line. I've also installed the Buildr plugin for Intellij IDEA. But I can't run commands such as compile from the IDE. It gives the following message:

/usr/local/bin/buildr compile
(in /path/to/project, development)
Compiling scala-spike
Compiling scala-spike into /path/to/project/target/classes
Buildr aborted!
RuntimeError : Are we forgetting something? JAVA_HOME not set.

But JAVA_HOME is set. The command echo $JAVA_HOME prints the correct path where Java is installed.


Solution

  • Make sure that you are passing JAVA_HOME while starting idea.sh. Try starting IDEA with sh -c "export JAVA_HOME=/opt/java && $IDEA/bin/idea.sh"