LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 12-13-2002, 07:57 PM   #1
yevbo23
LQ Newbie
 
Registered: Dec 2002
Posts: 19

Rep: Reputation: 0
Java bash Mandrake9


Hello, I am trying to set a classpath for Java (java resides in /usr/java/j2sdk1.4.0_03/bin/ in my case) in Mandrake9. How do I do it? Do put this line:

export PATH=$PATH:/usr/java/j2sdk1.4.0_03/bin/

in both or either:

1.) /etc/bashrc
2.) /etc/profile

and if yes, then where exactly in file? As you've probably guessed by now, I am using bash shell. Thanks for your help!

--Gene
 
Old 12-13-2002, 09:46 PM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Not /etc/bashrc, but rather ~/.bash_profile

And it depends on your wants, if you want this to be in the path for all users, then I'd stick it in /etc/profile, but if you want it for specific users only, then the bash_profile is for that.

Cool
 
Old 12-13-2002, 09:57 PM   #3
yevbo23
LQ Newbie
 
Registered: Dec 2002
Posts: 19

Original Poster
Rep: Reputation: 0
so where exactly in the file do I stick it? Because there is code that I am not sure I understand very well...
 
Old 12-13-2002, 10:32 PM   #4
jdc2048
Member
 
Registered: Jul 2002
Distribution: Redhat, Gentoo, Solaris, HP-UX, etc...
Posts: 391

Rep: Reputation: 30
It doesn't really matter, unless you stick it in an "if, then, else" structure. You can place it at the end of the file and should not have any problems.

You mentioned you were trying to set "classpath" though. If this is the case you want to make it:

export CLASSPATH=$CLASSPATH:/usr/java/j2sdk1.4.0_03/bin/

However if you were just trying to set the PATH to the java executable, then what you had is correct.
 
Old 12-13-2002, 10:48 PM   #5
yevbo23
LQ Newbie
 
Registered: Dec 2002
Posts: 19

Original Poster
Rep: Reputation: 0
Hmmphh, I put my thing in /etc/profile, and now i can't login into either KDE or GNOME, only IceWM works, and even there in shells I can't do anything, not su or ls or anything... How I fix it?
Thanks...
 
Old 12-13-2002, 11:12 PM   #6
yevbo23
LQ Newbie
 
Registered: Dec 2002
Posts: 19

Original Poster
Rep: Reputation: 0
Never mind, logged in as a root, removed this stuff, now everything works.
Grrr...
 
  


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
Configuring Bash (.bashrc) for use with Java Sir Nerdalot Linux - General 2 11-13-2005 08:42 AM
Mandrake9.2, bash: /cannot execute binary file premier_la Linux - Software 10 01-23-2004 02:53 AM
Java, Tomcat, Apache2.0.47, Mandrake9.2 help lazat Linux - Software 6 12-16-2003 08:33 AM
java path in bash matador Mandriva 2 12-03-2003 08:51 AM
Mandrake9/Java-VM ZoneAlert Linux - Newbie 2 03-09-2003 09:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:55 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