My Java GUI Toast Library working on windows not on Linux

I have a made a Java Library to show Android like Toast messages called JSubs : GitHub

Its working perfectly fine in my Windows 10 Computer.

enter image description here

But whenever I try it on Linux(Kali Linux) the system crashes and also the message does not show properly .

enter image description here

My code :

import com.jaysmito.jsubs.JSubsConstants;
import com.jaysmito.jsubs.SubsFrame;
import com.jaysmito.jsubs.Toast;

import java.util.Scanner;

public class Main {
    public static void main(String() args) throws Exception{
        Toast.showToast("Hello World!");
    }
}

I am not much experienced with Linux.

How can I make it computable with Linux too?