3

On Ubuntu 12.04.2 LTS 64bits, when using sudo or sudo -i or sudo su or even su in a session, in order to use both Java AND Scala I need to enter the following commands:

sudo -i
CLASSPATH=$CLASSPATH:/usr/share/java/scala-library.jar
export CLASSPATH

Is it possible to make these changes permanent and effective when I boot?

I've tried to include CLASSPATH=$CLASSPATH:/usr/share/java/scala-library.jar into .bashrc of both my user account and the root account but this change isn't taken when using sudo, or sudo -i or sudo su or even su!

TIA for any help on this problem.

Fnux
  • 145

1 Answers1

1

You could use the env_keep configuration option in sudoers and add "CLASSPATH" so that the CLASSPATH environment variable is carried into the sudo environment. This would only work if CLASSPATH is already set in your home environment, but it sounds like you've already got that far.

This discussion on the Ubuntu Forums might help.

Arkanon
  • 182