Coffeehouse Post

Single Post Permalink

View Thread: why does java have a classpath? ( or why doesn't .NET have one ? )
  • User profile image

    So I am seeing that in Java the CLASSPATH is the path of the directory that contains the Java classes your app is running. How is it that Java has a classpath and .net does not?  In .NET all the assemblies are copied to the bin directory of the .exe file. There is the GAC, but how commonly is the GAC used for user written applications? 

    So why doesn't Java do the same thing?  Even the PATH environment variable that is so important in Java and Unix, not so in Windows. Is the difference because Windows apps copy all the binaries into the bin directory?

    I kind of like the CLASSPATH and PATH approach if it enables me to keep from having multiple copies of assemblies across the system. But maybe that convenience breaks down as each app is built against a different version of the same named assembly.

    Interested to know the official rational for Java having a classpath but not .NET.