This is a simple classpath problem. The javac compiler and the java virtual machine
don't know where to look for the class file Student after it started running the
other class. Simply add the classpath variable to them like this:
The first line compiles both java files and sets the classpath to the current
directory (it reads: minus-c-p-space-dot). The last line runs your class given the
same classpath value.
kind regards,
Jos
don't know where to look for the class file Student after it started running the
other class. Simply add the classpath variable to them like this:
Code:
javac -cp . *.java ... java -cp . ShowStudent
directory (it reads: minus-c-p-space-dot). The last line runs your class given the
same classpath value.
kind regards,
Jos
Comment