LinuxQuestions.org
Visit the LQ Articles and Editorials section
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
 
LinkBack Search this Thread
Old 05-29-2007, 06:15 AM   #1
Raakh
Member
 
Registered: May 2007
Posts: 128

Rep: Reputation: 15
Neither JAVA_HOME nor the JRE_HOME variable defined


I have my dedicated server and am using putty

I want to set my classpath.

when I am using the command from apache-tomcat-5.5.20/bin/sh classpath.sh then message appears
"Neither JAVA_HOME nor the JRE_HOME variable defined"

PROBLEMS:
1. how do i correct this error
2. how do i set the classpath using putty

thanks & best regards
 
Old 05-29-2007, 07:03 AM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Hi and welcome to LQ. Firstly what Linux distribution are you using. You need to set JAVA_HOME in your /etc/profile or .bash_profile. The JAVA_HOME variable should point to the directory containing your java installation. There are other methods depending on your distro.
 
Old 05-29-2007, 11:57 AM   #3
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by reddazz
Hi and welcome to LQ. Firstly what Linux distribution are you using. You need to set JAVA_HOME in your /etc/profile or .bash_profile. The JAVA_HOME variable should point to the directory containing your java installation. There are other methods depending on your distro.
I don't know as I never used linux and I have provided dedicated server with login password. I am using putty to login
 
Old 05-29-2007, 01:43 PM   #4
shadowdancer
Member
 
Registered: Jan 2007
Location: Indonesia
Distribution: openSUSE, Slackware, Now Debian, and now again: Ubuntu
Posts: 61

Rep: Reputation: 15
so...probably you have to do this every login.

export JAVA_HOME=/opt/jdk_1.6/
export JRE_HOME=/opt/jdk_1.6/jre

replace /opt/jdk_1.6/ with your JAVA directory...
 
Old 05-29-2007, 02:19 PM   #5
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Quote:
Originally Posted by Raakh
I don't know as I never used linux and I have provided dedicated server with login password. I am using putty to login
To find out the distro, try the following
Code:
cat /etc/*-release
Post back the output.
 
Old 06-02-2007, 02:27 AM   #6
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by reddazz
To find out the distro, try the following
Code:
cat /etc/*-release
Post back the output.
output:
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64"
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
 
Old 06-02-2007, 04:02 AM   #7
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
From the output, the distribution that you are running is SUSE Linux Enterprise Server 10. You can set JAVA_HOME permanently by putting a little script similar to the one below in /etc/profile.d
Code:
export JAVA_HOME=/path/to/java/dir
Make sure you use the path of your own java directory. Save the file as java_home.sh in /etc/profile.d and make it executable by doing
Code:
chmod +x /etc/profile.d/java_home.sh
 
Old 06-02-2007, 04:49 AM   #8
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by reddazz
From the output, the distribution that you are running is SUSE Linux Enterprise Server 10. You can set JAVA_HOME permanently by putting a little script similar to the one below in /etc/profile.d
Code:
export JAVA_HOME=/path/to/java/dir
Make sure you use the path of your own java directory. Save the file as java_home.sh in /etc/profile.d and make it executable by doing
Code:
chmod +x /etc/profile.d/java_home.sh
I am really thankful to you

Plz let me know about classpath how can I see and add more in classpath

thanks again
 
Old 06-02-2007, 06:35 AM   #9
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
The classpath is an environment variable like JAVA_HOME. You can see what's in it by doing a "echo $CLASSPATH" in the shell. If there's no output, then it's not set. To set it, you use the same export statements that reddazz gave. If you just want to add a directory to your classpath, you would use an export statement, but you'd include the old classpath in it as well, e.g. "export CLASSPATH=$CLASSPATH:/foo", which says that the classpath should be set to the old value, but with /foo added. Directories are separated by colons in environment variables.
 
Old 06-02-2007, 06:40 AM   #10
Raakh
Member
 
Registered: May 2007
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Nylex
The classpath is an environment variable like JAVA_HOME. You can see what's in it by doing a "echo $CLASSPATH" in the shell. If there's no output, then it's not set. To set it, you use the same export statements that reddazz gave. If you just want to add a directory to your classpath, you would use an export statement, but you'd include the old classpath in it as well, e.g. "export CLASSPATH=$CLASSPATH:/foo", which says that the classpath should be set to the old value, but with /foo added. Directories are separated by colons in environment variables.

VERY VERY Thankful to you

thanks again
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace variable with user defined variable ce124 Programming 10 04-13-2007 09:29 AM
Tomcat5 doesn't find JAVA_HOME environment variable isra_mv Linux - Software 4 09-23-2006 01:42 PM
my JAVA_HOME environment variable changes automaticly petertavenier Linux - Newbie 3 04-20-2006 02:30 AM
# ./startup.sh Neither the JAVA_HOME nor the JRE_HOME environment variable is defined Niceman2005 Linux - Newbie 3 06-29-2005 01:58 PM
JAVA_HOME Variable yea420 Linux - Software 6 08-29-2004 06:37 PM


All times are GMT -5. The time now is 09:06 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration