XCode Error – Command /usr/bin/javac failed with exit code 2 – Java

I am using XCode to compile and run a Java program. I have an error like this:

javac: file not found: .java
Usage: javac <options> <source files>
use -help for a list of possible options
Command /usr/bin/javac failed with exit code 2

when I attempt to build the program. I thought that the error might I have been due to the fact that the name of my target and file are different, but both are file_name.java.

Could someone also explain how to run XCode with Java, without Terminal? I know there are questions like this already answered, but I have trouble after building the program (successfully).

Also, I did compile another program and the build succeeded, but there was no class file for it (file_name.class) in Finder.

Thanks!