tags:

views:

113

answers:

1

I have a class in another package. I'm trying to access that class by writing classpath header in command prompt with directory structure.

My question is why I'm not getting compile time error, because I've not specified any jar file which is necessary to compile that java source file, as command prompt classpath header will override environment CLASSPATH variable.

+1  A: 

Maybe Java is picking up the classpath from your environment settings.

If you are on windows do a set from the the command line and look for a CLASSPATH variable.

If you are on *nix do a env | grep -i classpath.

By default Java will look in the local directory (aka java -classpath .) but if the external classes are hidden away outside of your current directory then Java is probably picking them up from an environment variable.

jckdnk111