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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-29-2007, 06:15 AM
|
#1
|
|
Member
Registered: May 2007
Posts: 128
Rep:
|
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
|
|
|
|
05-29-2007, 07:03 AM
|
#2
|
|
Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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.
|
|
|
|
05-29-2007, 11:57 AM
|
#3
|
|
Member
Registered: May 2007
Posts: 128
Original Poster
Rep:
|
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
|
|
|
|
05-29-2007, 01:43 PM
|
#4
|
|
Member
Registered: Jan 2007
Location: Indonesia
Distribution: openSUSE, Slackware, Now Debian, and now again: Ubuntu
Posts: 61
Rep:
|
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...
|
|
|
|
05-29-2007, 02:19 PM
|
#5
|
|
Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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
Post back the output.
|
|
|
|
06-02-2007, 02:27 AM
|
#6
|
|
Member
Registered: May 2007
Posts: 128
Original Poster
Rep:
|
Quote:
|
Originally Posted by reddazz
To find out the distro, try the following
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
|
|
|
|
06-02-2007, 04:02 AM
|
#7
|
|
Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
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
|
|
|
|
06-02-2007, 04:49 AM
|
#8
|
|
Member
Registered: May 2007
Posts: 128
Original Poster
Rep:
|
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
|
|
|
|
06-02-2007, 06:35 AM
|
#9
|
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,466
Rep: 
|
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.
|
|
|
|
06-02-2007, 06:40 AM
|
#10
|
|
Member
Registered: May 2007
Posts: 128
Original Poster
Rep:
|
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
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:13 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|