I am trying to compile my project using javac command line tool, but without success. As most of you, I use a powerful IDE when developing and don't bother myself with such a trivial task like it is compiling.
Now when I want to try and build a larger project than a few source files the first time, I don't want to believe that it is so complicated.
My project's file structure is something like that:
I don't know for sure (because always use an IDE to develop), but to my opinion you have to get correct order to compile stuff using the command line. So if your 2nd package is depending on the 1st package you have to compile the 1st package. And to compile the 2nd package successfully you have to add the dir with the class files of 1st package to the classpath when using javac.
What's the reason why you would use javac to compile your classes? Why don't take the easy road and use an IDE (or an Ant build file for example).
I never used that tool . I used Eclipse initially to compile and when near complete used Roel's Ant script, found here: Ant Build for SCJD. Ant really simplifies things and the learning curve is not too steep. It is really worthwhile to learn how to use it.
javac -d classes -sourcepath src [path to the main class: src\rootPacket\MainClass.java]
The sourcepath tells the location form where to look for the dependencies (that the main class needs). Since all the classes are dependent on one another, they all get compiled. I am afraid that will not be the case, when there are classes in the source directory that are never used by other classes.