What is the difference between Path and ClassPath in Java?

Why do we need Path and ClassPath? When using an IDE like eclipse, do we still need to add a path?

+7
source share
9 answers

the path is the intermediary between the developer and the operating system to tell the path of the binary file where, since the Classpath is the intermediary between the developer and the compiler to tell the path to the library file that is used in our source code

+6
source

jre, java , jvm . , , jvm .

, java,

+3

PATH CLASSPATH java- IDE, Eclipse.
Java- CMD.

-: , PATH CLASSPATH

enter image description here

-:

java Demo.java, D:\Programs\Classes. D:\Programs\Classes CMD javac Demo.java. javac PATH. Java- Demo.java , PATH ​​ %JAVA_HOME%\bin.

( ) - D:\Programs\Classes, , java Demo, . CLASSPATH, CLASSPATH D:\Programs\Classes.

CMD .. java PATH , CLASSPATH, .

+3

: bin ( ) example- java.exe, javac.exe

classPath: .class ( java)

+1

- . , , (.exe) , .class. Location.

+1

PATH - , . . bin JDK JRE, .

CLASSPATH - Java-, , .

0

path pathpath

path classpath Java

path java- java-, java, javac, javap. javac . classpath , , , .

http://www.tutorial4us.com/java/difference-between-path-and-classpath

0

PATH CLASSPATH , PATH - , JDK, "java" "javac", java java. , CLASSPATH, , System Application ClassLoader Java, .class.

: http://www.java67.com/2012/08/what-is-path-and-classpath-in-java-difference.html

0

:

) , . ) PATH - , . . )

CLASSPATH a) , Java , .. J2EE jar. ) Classpath - , Java. Java . ) .

0

Source: https://habr.com/ru/post/1611149/


All Articles