main class not found
I am having trouble with a simple Java project. When I try to run the program, I get a ClassNotFoundException on the main class.
When I look at the actual invocation in the console output, I do not see the module directory on the classpath.
When I look at the run configuration, the main class name and the Use Classpath Of Module look correct. Nothing is red.
I'm sure this is something simple, but where should I look to find the problem?
Please sign in to leave a comment.
Could you please prepare and provide a small sample project illustrating the problem and
the exact steps to reproduce (complete zipped source tree and project files)?
I don't know how to create a project that has this problem. All I know is that I have a project with this problem. I am not willing to send this project to you.
If you have some suggestions of where to look or experiments to perform, that would be helpful.
Alan
Attach a screenshot of this class in the project view and the screenshot of the run/debug configuration.
Make sure it's not excluded from compilatio.
Here
Attachment(s):
Screen Shot 2015-07-26 at 8.53.32 AM.png
Post the full command line from the Run console (starting with java call, the first line that you can expand) and the exact error java reports.
Ensure Make before launch is enabled and there is a compiled .class file in the output folder.
Found it!
The project output folder path was wrong -- it was "build/working/test" instead of "/build/working/test".
But this raises more questions...
Why did the build not complain? If it put the class files somewhere, why did it not include that directory in the class path?
Attachment(s):
console.txt.zip