bhomass
asked on
compile java classes with circular dependency
I am using JavaCompiler from apache commons jci.
How are you suppose to take care of multi pass compilation especially when you have circular dependency between two java classes. A calls B, and B calls A. is there an order or particular way to call the compiler, so it will take care of the circular dependency?
How are you suppose to take care of multi pass compilation especially when you have circular dependency between two java classes. A calls B, and B calls A. is there an order or particular way to call the compiler, so it will take care of the circular dependency?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I don't see any api that will run 2 passes. if I use
compile(java.lang.String[] pResourcePaths, ResourceReader pReader, ResourceStore pStore, java.lang.ClassLoader pClassLoader)
will it automatically run twice?
compile(java.lang.String[]
will it automatically run twice?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
wonderful. by talking thru this with you guys, I walked into the answer.
indeed the api I posted does the job.
thanks.
indeed the api I posted does the job.
thanks.
Other remark: classes do not call each other, but call each others' methods.
That makes it easy to compile the lot in 2 runs.
A a = new A(); // Calls the constructor.
;JOOP!