Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/11/2015, 03:52
Avatar de Profesor_Falken
Profesor_Falken
 
Fecha de Ingreso: agosto-2014
Ubicación: Mountain View
Mensajes: 1.323
Antigüedad: 9 años, 8 meses
Puntos: 182
Respuesta: ECLIPSE Java: the code for the static initializer is exceeding the 65535 b

Buenas,

Ese limite viene implicito en la JVM y la estructura del bytecode. El codigo de los metodos (la inicializacion estatica se considera un metodo) tiene un limite de 64K.
Este limite no se puede cambiar.

Para solucionarlo puedes declarar las variables en varias clases o bien delegar la inicializacion a otros metodos.

Por ejemplo, si tienes:

Código Java:
Ver original
  1. static String[] variable1 = {"", "", "", "" ......}
  2. static String[] variable2 = {"", "", "", "" ......}

Lo puedes hacer asi:

Código Java:
Ver original
  1. static String[] variable1 = initVariable1();
  2. static String[] variable2 = initVariable2();
  3.  
  4. private static String initVariable1() {
  5.    return new String[] {"", "", "", "" ......};
  6. }
  7.  
  8. private static String initVariable1() {
  9.    return new String[] {"", "", "", "" ......};
  10. }


Un saludo
__________________
If to err is human, then programmers are the most human of us