Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Beginning Java and the fly likes java class file size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java class file size" Watch "java class file size" New topic

java class file size

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

Hi all,
I have read some where that the max size of a compiled java class file is 64KB. Is it true? If true, why is there a file size limitation.
Thanks in advance.

Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
As far as I know there is no u[ward limit on the total size of the compiled class file. There are however severalo other things that make up the byte code that are limited to 64k. The value of the code_length (the number of bytes in a method), might be what you heard of that is confusing you.
For all of the details check out the virtual machine specification.

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: java class file size
It's not a secret anymore!