setting the JAVA_HOME environment variable

James Gray james at
Mon Mar 24 08:48:38 UTC 2008

On 24/03/2008, at 7:35 PM, Thufir wrote:
---8<---  SNIPPED ---8<---
> extconf.rb:33: JAVA_HOME is not directory. (RuntimeError)
> thufir at arrakis:~$
> thufir at arrakis:~$ echo $JAVA_HOME
> /usr/lib/jvm/java-6-sun/jre/bin/java

The error message is correct - JAVA_HOME is a directory, not the Java  
binary.  In your case it appears you need to replace your existing  
$ export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre

In short the JAVA_HOME variable should be the *directory* that  
contains the "bin" directory that holds your preferred java binary.   
IOW "/usr/lib/jvm/java-6-sun/jre" (ie, JAVA_HOME) holds "bin/" which  
holds your preferred "java" binary, so when you string it together you  
end up with (mathematically):
/usr/lib/jvm/java-6-sun/jre + bin/ + java = /usr/lib/jvm/java-6-sun/ 

Voila :)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2417 bytes
Desc: not available
URL: <>

More information about the ubuntu-users mailing list