user1569948
user1569948

Reputation: 21

java.lang.Error - Unresolved compilation error

I'm getting this weird error,

java.lang.Error: Unresolved compilation problem: 
    The code of method render(GameContainer, StateBasedGame, Graphics) is 
    exceeding the 65535 bytes limit

People have been telling me to break down the bytes or something and I don't know what they mean or how to do it render is a void that has graphics g, and state based game and game container. Could someone explain to me how to fix it?

Upvotes: 2

Views: 885

Answers (1)

Jack
Jack

Reputation: 133577

As pointed out here, talking about classes:

The value of the code_length item must be less than 65536.

This means that you can't go over 64kb of raw bytecode.

In any case I think that this is the least of your problems since you shouldn't reach that limit at all in a single file. Just take out classes:

  • if you are using inner classes just extract them to separated files
  • if you are not using inner classes then there should be something really wrong in the code since this means really longs methods, consider refactoring methods

Upvotes: 2

Related Questions