LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-06-2008, 03:28 PM   #1
Jayla
Member
 
Registered: Nov 2005
Location: Suffolk, UK
Distribution: kubuntu 9.04
Posts: 188

Rep: Reputation: 30
Can't find JAVA_HOME, driving me crazy!


Hey Guys

I did manage to find JAVA_HOME once, but after a restart the path was lost and now I have no idea how to find it again.

I'm on ubuntu hardy, 64bit. I need JAVA_HOME set so I can run a Grails application, heres what I've done so far..

Checked the $PATH
Code:
jimmy@nevada:~/Applications/bsplus/bs-plus$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/jimmy/Applications/grails-1.0.3/bin/
Have a look for where java might be
Code:
jimmy@nevada:~/Applications/bsplus/bs-plus$ whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/lib64/java /usr/share/java
Set JAVA_HOME to where I think it should be
Code:
jimmy@nevada:~/Applications/bsplus/bs-plus$ echo $JAVA_HOME
/usr/lib/jvm/java-6-sun/jre/bin/
try running grails
Code:
jimmy@nevada:~/Applications/bsplus/bs-plus$ grails
grails: JAVA_HOME is not defined correctly; can not execute: java

Just out of interest...
Code:
jimmy@nevada:/usr/lib/jvm$ ls -l
total 12
drwxr-xr-x 7 root root 4096 2008-06-23 19:26 cacao
drwxr-xr-x 5 root root 4096 2008-05-10 23:32 java-1.5.0-gcj-4.2-1.5.0.0
lrwxrwxrwx 1 root root   19 2008-05-25 22:07 java-6-sun -> java-6-sun-1.6.0.06
drwxr-xr-x 6 root root 4096 2008-05-25 22:07 java-6-sun-1.6.0.06
lrwxrwxrwx 1 root root   26 2008-05-10 23:32 java-gcj -> java-1.5.0-gcj-4.2-1.5.0.0

Can anyone please give me a heads up on where I may be going wrong?

Regards

J
 
Old 07-06-2008, 03:58 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,896

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
In my openSUSE installation, JAVA_HOME (for 64 bit) is /usr/lib64/jvm/jre.

JAVA_HOME=/usr/lib64/jvm/jre
export JAVA_HOME
 
Old 07-06-2008, 04:46 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by bigrigdriver View Post
In my openSUSE installation, JAVA_HOME (for 64 bit) is /usr/lib64/jvm/jre.

JAVA_HOME=/usr/lib64/jvm/jre
export JAVA_HOME
Yup, just add this export to your users .login_profile or .bashrc so it's always set.

export JAVA_HOME=/path/to/java/jre

I like to eliminate the two step process and put the export in first line.
 
Old 07-06-2008, 05:09 PM   #4
Jayla
Member
 
Registered: Nov 2005
Location: Suffolk, UK
Distribution: kubuntu 9.04
Posts: 188

Original Poster
Rep: Reputation: 30
Thanks for the replies guys

I've tried /usr/lib64/jvm/jre but grails still complains that Java home is still incorrectly set

Is there any "cheat" way of finding what it should be? I'm running Azureus which is a Java based torrent client, so I must already have a java home set someplace?
 
Old 07-06-2008, 10:24 PM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by Jayla View Post
Thanks for the replies guys

I've tried /usr/lib64/jvm/jre but grails still complains that Java home is still incorrectly set

Is there any "cheat" way of finding what it should be? I'm running Azureus which is a Java based torrent client, so I must already have a java home set someplace?
Ok, I didn't know what grails is but now I looked it up. You clearly need SDK and not the JRE Java environment. From the looks, you only have JRE installed.

From the installation page http://grails.org/Installation

Code:
Prerequisites

In order to start using Grails you need to have the following:

    * An installation of Java SDK 1.4 or higher and have set your JAVA_HOME variable to the SDK install location.
 
Old 07-07-2008, 04:22 AM   #6
Jayla
Member
 
Registered: Nov 2005
Location: Suffolk, UK
Distribution: kubuntu 9.04
Posts: 188

Original Poster
Rep: Reputation: 30
Thanks tricky

I have had it working on this machine before, and nothing on the Java side has been modified, how can I search for any folder containing "jdk"? As its possible I'm looking in the wrong places
 
Old 07-07-2008, 09:20 AM   #7
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,896

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
su to root and run 'updatedb' (without quotes). Then use the locate command: locate jdk, or possibly slocate jdk.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
X11 driving me crazy.... trawler Linux - Newbie 3 10-11-2005 06:40 PM
[ ] @ are driving me crazy FireInTheDark Linux - Software 1 11-28-2004 10:42 AM
Sound driving me crazy eatstatic Slackware 7 11-21-2004 04:47 PM
Help this is driving me crazy!!!!!! Wolfy Linux - Hardware 1 07-07-2004 02:32 AM
ATi's driving me crazy... Hammett Linux - Software 0 04-21-2004 04:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration