🧔 Hello World

My name is Emil. I am a programmer, passionate by coding, music, video and photography

How to install Weka in Ubuntu and avoid OutOfMemoryException

Normaly, the official download page for Weka is waikato.ac.nz or sourceforge.net, in case that you need to install Weka on Windwos or Mac OSX machine, and you have to download the software as ZIP or EXE file.


In Ubuntu, installation process is much easier, Weka package beeing in official Ubuntu packages listed. From Ubuntu Terminal run the following cmd:

sudo apt install weka

After installation you can see the Weka icon in Main Menu. Anyway, if you start the program from there, will start with Memory limitation and if you have a large set of data, for example 100.000 rows in csv, JAVA will crash quickly. To avoid such thing you need to find Weka installation Folder.

Finding Weka installation folder in Ubuntu:

dpkg --listfiles weka

# as alternative you can use:
# whereis weka

Now you know where the folder is and what Path has. So you can start Weka with 2Gb Memory or more using the following command in Terminal:

java -Xms1024m -Xmx2048m -Xss1024m -jar /usr/share/java/weka-3.6.14.jar

Boo, that is all! Have fun on with large sets of data using Regression Classifiers!