Hi guys I'm new, I'm trying to compile and run a program from the command line to learn. I'm having difficulty with the running part, I keep getting these messages:
Error: Could not find or load main class .\main\java\org\example\App.class
Caused by: java.lang.ClassNotFoundException: /\main\java\org\example\App/class
I compile using javac and goes fine, then I try to run it but to no avail, I tried from the src, from the root but nothing ... can't seem to find the file... why?
#Java from command line, java class not found, class not found exception
1 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @dim silo! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
you need to use dot instead of slashes
Error: Could not find or load main class .\org\example\App.class
Caused by: java.lang.ClassNotFoundException: /\org\example\App/class
ah.. sorry
use dots instead of slashes. And don't use extension .class
so it will be java org.examplse.App