0

We have classpath in java? What it is?

Do we have classpath in C# also? If not what is in C# equivalent to classpath?

Devdutta Goyal
  • 985
  • 2
  • 11
  • 27
  • 1
    The classpath is the path where all the class files can be found. – Slaw Jan 22 '20 at 05:46
  • @Slaw , can i run a java application solely with maven without setting classpath?? – Vishwa Ratna Jan 22 '20 at 05:54
  • Build tools like Maven and Gradle automatically set the classpath (by specifying the `-cp` argument to the appropriate command) based on the declared dependencies and executed goal/task. Though such build tools are only used during development. – Slaw Jan 22 '20 at 05:55

1 Answers1

0

From PATH and CLASSPATH

PATH

The PATH environment variable is a series of directories separated by semicolons (;). Microsoft Windows looks for programs in the PATH directories in order, from left to right. You should have only one bin directory for the JDK in the path at a time (those following the first are ignored), so if one is already present, you can update that particular entry.

The following is an example of a PATH environment variable:

C:\Java\jdk1.7.0\bin;C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem

CLASSPATH

The CLASSPATH variable is one way to tell applications, including the JDK tools, where to look for user classes. (Classes that are part of the JRE, JDK platform, and extensions should be defined through other means, such as the bootstrap class path or the extensions directory.)

So CLASSPATH is only specific to java

Community
  • 1
  • 1
Sumit Singh
  • 15,743
  • 6
  • 59
  • 89