LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-04-2003, 10:07 PM   #1
lifted_one
LQ Newbie
 
Registered: Nov 2003
Location: phx
Distribution: Mandrake 9.1; Redhat 9
Posts: 9

Rep: Reputation: 0
Java SDK 1.4.2 install.


Hey guys.

I've installed (self-extracting bin) the Java SDK on my Mandrake9.1 system. Whats the easiest way to modify my PATH and CLASSPATH variables so that they get set everytime I restart the system. I do not want to be specifying them everytime I "javac" or "java".
If this topic has been asked over and over, please don't flame me.

Graci.
Kacper
 
Old 11-04-2003, 10:19 PM   #2
jhorvath
Member
 
Registered: Sep 2002
Location: OH, USA
Distribution: 2.6.16-1.2096_FC5 #1
Posts: 245

Rep: Reputation: 30
me..i'm lazy ..and i'm the only one who will *EVER* touch my notebook...so i just added it to /etc/profile ;)

but .. you can use

~/.bash_profile
~/.bash_login
and
~/.profile

those files are read in the exact order they're listed ...so if you override (meaning you completely redefine PATH with out appending it first), in any of them ...just make sure you have the java path in a 'higher' priority file. (~/.profile is last so that is highest)...

...export PATH=/path/to/java/bin/directory:PATH

Last edited by jhorvath; 11-04-2003 at 10:23 PM.
 
Old 11-06-2003, 12:21 AM   #3
nekromancer
Newbie
 
Registered: Nov 2003
Location: Niagara Falls, Canada
Distribution: Gentoo
Posts: 10

Rep: Reputation: 0
this is another alternative that I found usefull.
you can put this in your .bashrc file which should be in your home directory or can be in one of the bashrc files in /etc/ different distros have them different places..

JAVA_HOME="path of the sdk eg. /opt/sun-jdk-1.4.2.01"
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME PATH
 
Old 11-06-2003, 12:43 AM   #4
lifted_one
LQ Newbie
 
Registered: Nov 2003
Location: phx
Distribution: Mandrake 9.1; Redhat 9
Posts: 9

Original Poster
Rep: Reputation: 0
Well, all I did (on my Mandrake 9.1 system)...

export PATH=$PATH:/jdk142/bin:.
export CLASSPATH=/jdk142/lib:.
in my /home/username/.profile

and it worked just fine.

I've been reading some of these posts and it seems that a lot of people are having a hard time with this, creating a whole mess of other variables (JAVA_HOME...etc) and modifying a bunch of other "profile" files all over the place and creating other *.sh files just to do this...

Its not like the good old days where you just double clicked the "setup.exe" and the whole app. installed on its own and put a nice icon on your desktop
 
Old 11-06-2003, 12:55 AM   #5
nekromancer
Newbie
 
Registered: Nov 2003
Location: Niagara Falls, Canada
Distribution: Gentoo
Posts: 10

Rep: Reputation: 0
Maybe true, but I notice many programs look for a JAVA_HOME path especially the Eclipse Java compiler. Either way... making one extra variable path won't harm anyone.

Though your right about editing too many profile files.. thats why it's a good idea to do this once and make it system wide. Which is what I did on the Debian distro once.
 
  


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
Java SDK & JRE Install Avi Linux - Software 1 10-02-2005 08:32 PM
java SDK install jet_zeng Linux - Software 5 05-10-2005 11:57 AM
how to install java 2 sdk? pdmackenzie Linux - Software 9 04-07-2004 08:39 AM
Java 1.4.0 SDK install problem insom Linux - Newbie 3 09-05-2003 04:01 AM
Java SDK 1.4 Install KptnKrill Linux - Newbie 6 08-14-2003 08:47 PM


All times are GMT -5. The time now is 03:32 AM.

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