Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Help Configuring CLASSPATH for all users

  Asked By: Thelma    Date: Oct 27    Category: Java    Views: 847
  

I've just installed the j2sdk 1.4.0_03 on a Linux Red Hat 7.2.

I have configured the PATH & CLASSPATH variables by adding the next
piece of code to the .bashrc files of the users who want to use Java

PATH=/usr/java/j2sdk1.4.0_03/bin:$PATH
export PATH
export JAVA_HOME=/usr/java/j2sdk1.4.0_03
export
CLASSPATH=/usr/java/j2sdk1.4.0_03/lib/tools.jar:/usr/java/j2sdk1.4.0_0
3/jre/lib/rt.jar:./

and it works fine!!!

The PROBLEM is that I HAVE TO ADD that piece of code to EVERY
single .bashrc file (one per user). If the number of users increases
then I have to work more and more and more... hehehehe. Does anybody
know if I can add the same code to another file so it has effects on
all of the users?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Vonda Ramirez     Answered On: Oct 27

there must be a file named ".profile" for this purpose, isn't it, correct me;

 
Answer #2    Answered By: Bach-yen Nguyen     Answered On: Oct 27

Set it in /etc/profile. Depending on the version of linux  you are using there
might be better ways of doing this (eg. Redhat: look in /etc/profile.d/,
Gentoo: look in /etc/env.d). Just read through /etc/profile and you should
be able to determine how the distribution you are using works.

 
Didn't find what you were looking for? Find more on Help Configuring CLASSPATH for all users Or get search suggestion and latest updates.




Tagged: