java - Gradle finds wrong JAVA_HOME even though it's correctly set -
when trying run gradle, following error:
# gradle error: java_home set invalid directory: /usr/lib/jvm/default-java please set java_home variable in environment match location of java installation.
however, when check java_home variable get:
# echo $java_home /usr/lib/jvm/java-7-oracle
my java_home defined in .bashrc , have double checked set source.
running java -version
confirms java_home set correctly , on path.
# java -version java version "1.7.0_51" java(tm) se runtime environment (build 1.7.0_51-b13) java hotspot(tm) 64-bit server vm (build 24.51-b03, mixed mode)
i have checked /usr/bin/java
symlinks /etc/alternatives/java
in turn correctly symlinks /usr/lib/jvm/java-7-oracle/jre/bin/java
additionally i've checked there no duplicate java_home definitions in .bash_profile
or /etc/profile
.
so question how/why gradle find /usr/lib/jvm/default-java
, , more importantly how point correct directory?
other programs require jdk work fine, think gradle issue. i've tried reinstalling gradle made no difference.
i'm running 64bit xubuntu (ubuntu 13.10 base)
turns out particular gradle binary downloaded ubuntu 13.10 repository itself tries export java_home. lucas suggesting this.
/usr/bin/gradle
line 70:
export java_home=/usr/lib/jvm/default-java
commenting line out solves problem, , gradle finds correct path java binary.
if download binary website not have problem, it's issue ubuntu repo version. there seem other issues 13.10 version.
Comments
Post a Comment