Sunday, March 2

PATH - CLASSPATH



The name itself indicated the functionality...

CLASS-PATH : It contains the paths of class files which are stored
Ex: CLASSPATH="C:\Program Files\Java\jdk1.7.0_51\jre\lib\rt.jar"

PATH : It contains the path for the executables
Ex: PATH="C:\Windows\System32\notepad.exe"

PATH is the OS related..It contains executable file information like bin etc..
CLASSPATH is also related to OS only but it contains information like ZIP, JAR file..

PATH=$PATH: <JDK bin path> 
CLASSPATH=$CLASSPATH: <WL-Home\server\lib>


Set PATH as follows:
$export PATH=$PATH:/usr/java/jdk1.5.0_07/bin

To check the path Env variable(view the contents of PATH):
$ echo $PATH

ANSWER :
WebLogic Server installs the following script that you can use to set the classpath that a server requires:

WL_HOME\server\bin\setWLSEnv.cmd (on Windows)
WL_HOME/server/bin/setWLSEnv.sh (on UNIX)

PATH=$PATH: <JDK bin path>
CLASSPATH=$CLASSPATH: <WL-Home\server\lib>

WebLogic Server installs the following script that you can use to set the classpath that a server requires:
 WL_HOMEserver_insetWLSEnv.cmd (on windows) 
 WL_HOME/server/bin/setWLSEnv.sh (on UNIX)

1 comment:

  1. Difference between path and classpath in Java
    path is set for use java tool in your java program like java, javac, javap. javac are used for compile the code. and classpath are used for use predefined class in your program for example use scanner class in your program for this you need to set classpath.

    ReplyDelete