The situation is I have a java project which .java files scattered in many sub-folders.
I want to use javac to compile all the .java but I tried command below and failed:
javac -sourcepath src
And error was:
javac: no source files
Usage: javac
use -help for a list of possible options
So what should I do to compile this project?
Thank you!
-sourcepathspecifies where the javac will find the source files, not what files that you want to compile. You can specify the names of the files that you want to compile, e.g.javac -sourcepath src/ File.java AnotherFile.java, etc., it will look for the input files insrc/then. You can use the @ parameter, too, javac will then read the options and files from text file. Or you can use Ant or Maven, tools for automating software building.But I recommend using an IDE. I love Eclipse, but other IDEs, like NetBeans are ok, too.