Who set my CLASSPATH?

I never set CLASSPATH environment variable. Instead I always use the explicit -classpath or -cp options when running java, javac, javap, etc. The other day I was surprised to see a CLASSPATH environment variable is set:

C:\tmp> set CLASSPATH
CLASSPATH=.;C:\Program Files\Java\jre1.5.0_09\lib\ext\QTJava.zip

C:\tmp> dir "C:\Program Files\Java\jre1.5.0_09\lib\ext\QTJava.zip"
06/12/2006 09:57 AM 1,180,476 QTJava.zip
It seems when I installed apple's quicktime plugin, it automatically set this CLASSPATH in my environment. I don't like this. I always assume a clean environment when running any java applications. So I removed it:
C:\tmp> set CLASSPATH=

C:\tmp> set CLASSPATH
Environment variable CLASSPATH not defined
I can tolerate an installer modifying my PATH, but not CLASSPATH.


Ricky Clarkson said...

Quicktime used to be even more retarded; it would set your CLASSPATH but not include ., the current directory.

Unfortunately that means that beginner programmers using a text editor and a command line had to do this:

javac -classpath . NameOfFile.java
java -classpath . NameOfFile

I'm glad that isn't the case in the labs I teach in anymore.

Anonymous said...

This Quicktime is a dumb thing thats why I deleted/uninstalled this software.

Anonymous said...

As a new programmer in JAVA that is the first thing the free on-line course teaches.

Anonymous said...

I completely agree. but to make things worse after it sets the classpath, other programs like eclipse start using it as the jre classpath. so i had removed it form my variables and now the stupid eclipse doesnt work.

Anonymous said...

After all this time, I've encountered the same, sorry interference on my office computer and my home computer. I'm removing QuickTime and the entries in my PATH and CLASSPATH variables, partly to avoid their interfering, and partly out of pure vindictiveness. I haven't seen anything this lame since the bad old days when AOL was overwriting Windows files with its own versions. Application programmers, you fvckers, get your hands off the system and core programs.

Steve Smith said...

Great and Useful Article.

Online Java Training

Java Online Training India

Java Online Course

Java EE course

Java EE training

Best Recommended books for Spring framework

Java Interview Questions

Java Course in Chennai

Java Online Training India