Code too large compilation error in Java
A single method in a Java class may be at most 64KB of bytecode.
But you should clean this up!
Use .properties
file to store this data, and load it via java.util.Properties
You can do this by placing the .properties
file on your classpath, and use:
Properties properties = new Properties();
InputStream inputStream = getClass().getResourceAsStream("yourfile.properties");
properties.load(inputStream);
javac error code too large?
Methods in Java are restricted to 64k in the byte code. Static initializations are done in a single method (see link)
You may try to load the array data from a file.
Error: Code too large
Code is limited to 64K bytes and when you initialize an array you do this in code.
The best option is to store the data in a file and read the data you need. Note: the file can be deployed with the application and obtain directly from the archive.
Another option is to use a String instead (multiple Strings are not so limited in length) and parse it.
EDIT:
I suggest you write the data in a human readable form like
Cm7 Bm6 Am7 ....
Dm8 Cm7 Dm8 ....
....
Related Topics
Java Event-Dispatching Thread Explanation
Cut Out Image in Shape of Text
How to Wire One Pane to Another
Java.Lang.Classnotfoundexception When Running in Intellij Idea
Java Securityexception: Signer Information Does Not Match
Group by Multiple Field Names in Java 8
Why Does Java Prohibit Static Fields in Inner Classes
Where Are Static Methods and Static Variables Stored in Java
Refreshing Background Color for a Row in Jtable
Can't Add Value to the Java Collection with Wildcard Generic Type
Java "Void" and "Non Void" Constructor
How to Get the Exact Middle of a Screen, Even When Re-Sized
Tomcat 10.0.4 Doesn't Load Servlets (@Webservlet Classes) with 404 Error
Map Implementation with Duplicate Keys