How to compile a java project consisting of multiple files?

YD8877 picture YD8877 · Oct 24, 2010 · Viewed 7.2k times · Source

I have a java project which contains multiple classes spread out over multiple files.

How do i compile and get this to work ?

Can anyone suggest how to compile this using jCreator (without using a build tool like ant)

Answer

Brian Agnew picture Brian Agnew · Oct 24, 2010

Without using Ant/Maven etc. (and I would strongly advocate using these - a command line is unmaintainable as your project increases in complexity, and unless you script it you will have to remember how you invoked it last time when you next build) you should be able to pass all your .java files to the compiler on the command line. e.g. in Unix:

javac `find . -name \*.java'

or similar (you will likely need additional args for the classpath etc.)