LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-16-2006, 09:12 AM   #1
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Rep: Reputation: 30
java and classpath


Hi!

I'd like to know where I could find paths stored in CLASSPATH.
They must be stored somwhere because when I try to compile program
placed in JDK's folder it works, and when trying to compile the same
program from my home folder it shows errors. Conclusion is that
there is some file in which such paths are stored but where?.

Cheers
 
Old 03-17-2006, 02:20 AM   #2
Fredstar
Member
 
Registered: Jul 2004
Location: Rochester, NY
Distribution: Fedora9::FreeBSD7.1
Posts: 296

Rep: Reputation: 30
Quote:
Originally Posted by mac1234mac
Hi!

I'd like to know where I could find paths stored in CLASSPATH.
They must be stored somwhere because when I try to compile program
placed in JDK's folder it works, and when trying to compile the same
program from my home folder it shows errors. Conclusion is that
there is some file in which such paths are stored but where?.

Cheers
From command line

windows

set PATH=c:\PATH\TO\YOUR\JDK\BIN
set CLASSPATH=.

make sure when you set CLASSPATH you are in the folder with the .java file otherwise you will get the same error.

The above method will make you do this everytime so it might help to add the path to your jdk bin folder to your computers path.

In linux:

if using bash just add the directory at the end of your path.
 
Old 03-17-2006, 03:14 AM   #3
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
reply

Quote:
if using bash just add the directory at the end of your path.
I'm using Linux. What is "end of path"?. How is this done?.
But I'd like to look into file where all paths are stored.

Last edited by mac1234mac; 03-17-2006 at 03:15 AM.
 
Old 03-17-2006, 03:27 AM   #4
Fredstar
Member
 
Registered: Jul 2004
Location: Rochester, NY
Distribution: Fedora9::FreeBSD7.1
Posts: 296

Rep: Reputation: 30
Quote:
Originally Posted by mac1234mac
I'm using Linux. What is "end of path"?. How is this done?.
But I'd like to look into file where all paths are stored.
Well for each distro it could be diff.

Im using FedoraCore/Suse/OpenBSD

to see all variables


type: set |less

which will show you all set variables.

Now as setting your path you want to add onto your path. Best way to do this is

cd /home/you

ls -la

vim (vi, whatever you use) .bash_profile

you will see

PATH=$PATH:$HOME/bin

then just add the following

PATH=PATH:$HOME/bin:"YOUR PATH TO JDK/BIN"

hope it helps
 
Old 03-17-2006, 03:36 AM   #5
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
reply

I'm using Aurox 11.0, based on Fedora Core 3.
But I have following question:
In which file is stored path to /bin folder?.

Last edited by mac1234mac; 03-17-2006 at 04:44 AM.
 
Old 03-17-2006, 09:05 AM   #6
LLS
Member
 
Registered: Sep 2003
Location: North America
Distribution: FC6 FC7 F8
Posts: 75

Rep: Reputation: 15
Usually java paths are stored in /etc/profile.d/java.sh. An example from a fdc4 working setup would look like this of course your paths would conform to your setup.
Code:
CATALINA_HOME=/usr/local/apache-tomcat-5.5.12/
export CATALINA_HOME

JAVA_HOME=/opt/jdk1.5.0_06/
export JAVA_HOME

TOMCAT_HOME=/usr/local/apache-tomcat-5.5.12
export TOMCAT_HOME

ANT_HOME=/usr/local/apache-ant-1.6.5
export ANT_HOME

export PATH=${PATH}:${JAVA_HOME}/bin:${ANT_HOME}/bin:${TOMCAT_HOME}/BIN:${CATALINA_HOME}/BIN
 
  


Reply



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
Java Classpath... dear god... Jaster Programming 19 02-07-2005 03:57 PM
I've set the CLASSPATH, but I still get a noClassDefFoundError. (Java) Travis86 Programming 6 02-05-2004 09:09 AM
setting java classpath... brutal_brad Linux - Newbie 7 09-21-2003 02:52 PM
How to set classpath for java jolly Linux - Software 3 04-22-2003 10:02 PM
ClASSPATH variable for Java oulevon Linux - General 1 02-28-2001 08:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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
Open Source Consulting | Domain Registration