[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where do I edit the system wide classpath with Sun JVM?



On Sun, Feb 26, 2006 at 01:20:24PM +0100, Mladen Adamovic wrote:
> Joost Kraaijeveld wrote:
> >After installing the Sun JVM using  java-package I have a classpath.
> >Where do I edit (and add the PostgreSQL jdbc driver) this (systemwide?)
> >classpath?
> >  
> It should be in /etc/profile or ~/.profile (just for the current user).
> 
> I have in /etc/profile

I'm not a bigfan of having global CLASSPATH settings because this can
have issues with applications that don't work with some stuff on the
CLASSPATH correcty.

What I normally do is to write a shell script setting CLASSPATH (and
JAVA_HOME and others) and call the java executable with the application
from it. Makes it much more convenient.

> export 
> CLASSPATH=/usr/java/jdk1.5.0_06/lib/tools.jar:/usr/java/jdk1.5.0_06/jre/lib/rt.jar:./

Not that rt.jar and tools.jar are automatically found by SUN JDK and
dont need to be on the CLASSPATH. In fact rt.jar has to be on the
bootclasspath anyway. So your CLASSPATH can be reduced to

export CLASSPATH=.

(Which makes it quite awful. You need to be in the correct dir when
starting a java application.)


Cheers,
Michael
-- 
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html

Join the community at http://planet.classpath.org/



Reply to: