classpath - How to resolve this error Caused by: java.lang.ClassNotFoundException -
i wrote console application helloworld.java , ran javac helloworld.java,and java helloworld. worked fine.
i created package com.abc.project , moved helloworld.java it(the package import statement correctly generated package com.abc.project;). , ran javac helloworld.java worked fine , generated class properly.
however, when ran java com.abc.project.helloworld console, threw "class not found" error.
please can advise problem?
try running
java -cp absolute_path com.abc.project.helloworld
where absolute_path refers directory class files along packages present. bin directory class files generated along same directory structure source files
Comments
Post a Comment