Symbol not found error when new class in another Java file

/java/hello/Main.java /java/hello/Hello.java

~~ When I tried to new a class in Hello.java from Main.java with such a directory structure, I couldn't understand it, but when I javac from the java folder of the parent folder, it compiles. I don't understand the reason-When I looked it up with verbose, it said [source file search path:.], Which made me confused. For this directory structure, we could: It took me half a day to notice this because the source code was correct. ~~

You can look at the comment section, but it seems that the cause was the lack of class files. Therefore, you can execute it by javac Hello.java first.

I passed this, so I will post it as well. javac hello/Main.java

Recommended Posts

Symbol not found error when new class in another Java file
Error in ./gradlew: Symbol not found
HttpServletRequest class file not found
Cause of is not visible when calling a method of another class in java
"Error: Package xxx does not exist" "Error: Symbol not found" when rewriting kotlin
When calling println etc. from an external Java class file in Processing
Error in bundle install when running rails new
In WSL2, when I did `docker-compose up`, I got an error saying that the sh file was not found.
Error: Main class not found or could not be loaded
What's new in Java 8
Rails 6 startup error "Webpacker configuration file not found" Solution
What's new in Java 9,10,11
Customize the display when an error such as 404 Not Found occurs in Spring Boot
ERROR! MySQL server PID file could not be found!
What to do when Method not found in f: ajax
Resolve CreateProcess error = 206 when running Java in a Windows environment
When [command not found: composer] is displayed when [composer install] is displayed in Laravel
Today's java error: Error: Could not find or load main class
Show detailed error in Logger when running Java on server
Spring-Boot main class not found
Avoid Yubaba's error in Java
Error when playing with java
[java] What I did when comparing Lists in my own class
Text file placed in resources in Java cannot be read when jarted
[Java] Main class XXX was not found or could not be loaded
Avoid character code error in java when using VScode extension RUN-CODE
How to solve the unknown error when using slf4j in Java
ERROR: In file ./.env: environment variable name'THOR_SILENCE_DEPRECATION' may not contain whitespace.
Read Java properties file in C #
<java> When "EXCEPTION_ACCESS_VIOLATION" appears in awt
Unzip the zip file in Java
[Java] Do not use "+" in append!
Log output to file in Java
StringBuffer and StringBuilder Class in Java
Disable display when not logged in
About file copy processing in Java
Error when the member of Entity class used in SpringWebFlux is final