It is not mandatory that the driver program (main program) and the package(s) to be at the same location. So how does JVM know the path to the package(s)? There are three options: Placing the package in the current working directory. Specifying the package(s) path using CLASSPATH environment variable. Using the -classpath or -cp options with javac and java commands. If no package is specified, by default all the classes are placed in a default package. That is why no errors are shown even if we don’t use a package statement. By default Java compiler and JVM searches the current working directory
The post How to define CLASSPATH in java Programming appeared first on Coding Security.
How to define CLASSPATH in java Programming
read more
Tidak ada komentar:
Posting Komentar