This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Offhand I don't remember what if any intrinsic limits there may be in the process. But I'm not surprised that a 1 GB file causes problems. Perhaps you could tell us what is the text of the first few compile errors you get? That may well give important clues as to what, exactly, the problem is.
The compiler will not accept any sourcefile that has more than 64K lines in any single method. I'm pretty certain there are similar restrictions to the number of methods per class, data members per class, and classes per file.
Any class that big is a monster that needs serious refactoring anyway Or if it's generated, kill the generator.
Joined: Jul 08, 2005
Thanks for the help. I will get more details on it. Killing the generator is a nice idea
Hi all, I faced a similar problem in my project. We use one propertory IDE for development which generates the java code. I found two generated files of size 5 MB. And these files failed to compile because of the large size of methods. Then I manually edited the file and replaced the large methods with a set of small methods and written some logic to integrate these small methods. So that from out side it appeared the same but internally it calls these small methods.