• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maximum size of a Java Class file

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I was wondering what the maximum size a java class file can be.
I just wrote a class that was about a 100K in size, and Netbeans 5.0 told me the code was too large.
I split the data into 2 classes and there was no problem.

If you were wondering why my class was so big, its because for my chess application, I have decided to create the images from prestored arrays.
It avoids the hassel of loading images in, and the problems faced with loading when using JARs.

Thanks for any info.
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know. I looked in the JLS and there doesn't seem to be a maximum size there. . .
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Limitations of the Java Virtual Machine are found here:
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html
(at the bottom)

Perhaps your class mets one of the criterias - a direct size-of-class limit isn't mentioned there (but perhaps nearby?).
 
reply
    Bookmark Topic Watch Topic
  • New Topic