#Java says no source files found when trying to compile
1 messages ยท Page 1 of 1 (latest)
Here is an AI assisted attempt to answer your question ๐ค. Maybe it helps! In any case, a human is on the way ๐. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
The "no source files found" error usually means the javac command cannot locate your .java files. Common reasons:
- You're running
javacfrom a different directory than where the.javafiles are located. - Your source file path or filenames are incorrect or misspelled.
- Using wildcards incorrectly in the command line.
- No
.javafiles exist in the specified path.
Make sure to run the compilation command inside the directory containing the .java files or provide a relative or absolute path to them. For example:
javac YourFile.java
or, if all .java files must be compiled:
javac *.java
Double-check the directory you are in via pwd or dir depending on OS. Also, ensure your files have the .java extension, not .txt or something else.
If your files are organized in packages, you must compile from the root source directory and maintain the folder hierarchy corresponding to the package names.
Useful links: