One of my favorite things about Java: packaging both code and data in JAR files

Sure, other programming languages like Python, Lisp, and Smalltalk as faster to develop in (for the usual reasons: late binding, more interactive development, etc.). However, one feature of the Java platform that I really like is being able to easily package both compiled code and required data in a JAR file.

Typically, I serialize required runtime data to a binary file and when I create a JAR file I add the binary serialized data file as a top level entry. To read the data into memory, I use something like this:

InputStream ins =
ObjectInputStream p = new ObjectInputStream(ins);
Vector my_vector = (Vector) p.readObject();
// etc.

Then, I can just use the JAR file in other applications and I have both code and required data.


Popular posts from this blog

Custom built SBCL and using spaCy and TensorFlow in Common Lisp

I have tried to take advantage of extra time during the COVID-19 pandemic

GANs and other deep learning models for cooking recipes