//For CMD users, requires to be done whenever we start cmd, temporary
SET PATH=<insert JDKBIN location in here; no quotes; usually present inside program files/Java>
//For Using Javac without setting up jdk path each time
//Windows users requires admin access
//Press start type "environment variables"
//Click on Environment variables box in bottom of the System properties
//Add a new variable with variable name = "CLASSPATH" no quotes required
// Value is the location of Java/JDK/bin folder
java -classpath D:Projectin;D:Projectsrc Main
Output
Getting : D:Projectin;D:Projectsrc
Want : D:Projectin
java -classpath D:myprogram;D:myprogramlibsupportLib.jar org.mypackage.HelloWorld
set CLASSPATH=D:myprogram;D:myprogramlibsupportLib.jar
java org.mypackage.HelloWorld
java -classpath '.:/mylib/*' MyApp
classpath is just a set of paths where the java compiler and the JVM must find needed classes to compile or execute other classes.
java -classpath ".;c:mylib*" MyApp