#Java from command line, java class not found, class not found exception

1 messages · Page 1 of 1 (latest)

dim silo
#

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?

hoary cairnBOT
#

This post has been reserved for your question.

Hey @dim silo! Please use /close or the Close Post button 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.

wild crater
#

you need to use dot instead of slashes

tranquil depot
#

go into the main/java directory

#

and run java org.example.App

dim silo
#
Error: Could not find or load main class .\org\example\App.class
Caused by: java.lang.ClassNotFoundException: /\org\example\App/class
#

ah.. sorry

wild crater
#

so it will be java org.examplse.App

dim silo
#
Hello World!
#

works...

#

thank you very much

#

thank you again both