LinuxQuestions.org
Help answer threads with 0 replies.
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 06-20-2005, 06:33 AM   #1
mohama
Member
 
Registered: May 2005
Location: solar-system->earth->northern hemisphere
Distribution: ubunutu+knoppix+suse
Posts: 197

Rep: Reputation: 31
Unhappy how to set CLASSPATH


hi ,

i installed java to by computer and the problem is that i don't know how to set the java / javac / javadoc / jar .... as a CLASSPATH,
i mean to write
$ javac *.java for example insted of typing ...

$ /usr/java/jd....../bin/javac *.java


thanks a lot ,
 
Old 06-20-2005, 07:56 AM   #2
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
Add /usr/java/bin to your path in your file ~/.bash_profile.
Code:
vim ~/.bash_profile
 
Old 06-20-2005, 11:36 AM   #3
mohama
Member
 
Registered: May 2005
Location: solar-system->earth->northern hemisphere
Distribution: ubunutu+knoppix+suse
Posts: 197

Original Poster
Rep: Reputation: 31
Unhappy not so obvious ..

hi ,
thanks for your replay .... but i didn't get it ...

my question was how to add it to my path ... ???

thanks a lot ,
 
Old 06-20-2005, 05:40 PM   #4
FatDog
LQ Newbie
 
Registered: Jun 2004
Location: Southern CA
Posts: 10

Rep: Reputation: 0
Mohama: you missed part of the instructions:
Quote:
Add /usr/java/bin to your path in your file ~/.bash_profile
Your PATH is setup in your .bash_profile file.

Edit this file: ~/.bash_profile

Look for a row that says "PATH=".

Go to the end of this line and add ":/usr/java/..." (whatever your path to Java is) - Note: Dont forget the colon to separate the new path from the existing ones.

Save and exit.

Open a new shell window and try just saying:

"> javac <program name>"

Your old window WILL NOT work this way unless you do the ~/.bash_profile instruction that mrcheeks said.

Does this make sense?
 
Old 06-21-2005, 09:18 AM   #5
mohama
Member
 
Registered: May 2005
Location: solar-system->earth->northern hemisphere
Distribution: ubunutu+knoppix+suse
Posts: 197

Original Poster
Rep: Reputation: 31
Unhappy

hi ,

it does make sence but .... it dosn't work ...!?

i added ":/usr/java/jdk1.5.0_03/bin/javac" to my PATH= line in the .bash_profile file but , nothing changed , it doesn't work .

ps , can u explain for me what this command do
Code:
 vim ~/.bash_profile
??
because when i write this line in the shell it show me what there is in side this file ??

thanks ,
 
Old 06-21-2005, 10:52 AM   #6
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
VIM is just another text editor among others...
 
Old 12-15-2005, 04:49 PM   #7
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
According to my book Core Java2 to set your classpath do the following

export CLASSPATH=
 
Old 12-15-2005, 04:52 PM   #8
PerfectStranger
LQ Newbie
 
Registered: Dec 2005
Distribution: SuSE
Posts: 20

Rep: Reputation: 0
mohama,

Instead of adding ":/usr/java/jdk1.5.0_03/bin/javac" to your path, just add ":/usr/java/jdk1.5.0_03/bin". This will look in that folder for the "javac" executable whenever you type "javac" on the command line.
 
Old 12-17-2005, 04:17 AM   #9
creolophus
Member
 
Registered: Nov 2005
Posts: 34

Rep: Reputation: 15
try logging out & logging in again

or open a new shell
 
  


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
How to set the CLASSPATH environment variable Rodotheos Programming 3 06-20-2005 05:30 AM
how to set java classpath on Redhat 9? antony_csf Programming 9 11-26-2004 06:48 AM
How to set classpath for jdk jolly Linux - Software 5 05-01-2003 09:48 AM
How to set classpath for jdk jolly Linux - Software 4 05-01-2003 09:24 AM
How to set classpath for java jolly Linux - Software 3 04-22-2003 11:02 PM

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

All times are GMT -5. The time now is 05:26 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
Open Source Consulting | Domain Registration