Hello everyone,
I am a beginner Java programmer and need your help in understanding What are Environment
I do not use any IDE for Java programming at present and use Command Prompt instead

I would like to know about what is a CLASSPATH Variable and Is Classpath variable same as what we set using set path="___" in Command prompt?

I particularly face problems when I try using the user defined packages in Java..

Thank You

7 Years
Discussion Span
Last Post by ~s.o.s~

Think of environment variables as OS specific variables e.g. JAVA_HOME. In windows you set them using the command set JAVA_HOME="c:/Java" , in *nix, you do it as export JAVA_HOME=/env/java . More info here.

AFAIK, the CLASSPATH environment variable is used by your JVM process to "search" for classes. But I would rather recommend not to mess with environment variables and use the -classpath switch (for both java and javac). This would ensure that all the dependencies are explicitly mentioned.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.