Python から通知を送信するまでスレッドが終了しない 1 クラスの Java プログラムを作成できます。
このようにして、ライブラリはメモリに保持され、Python プログラムからアクセスできるようになります。
このクラスは次のようになります (必要な lib import/init を追加します):
public class TestPy {
    private Thread thread;
    public void die() {
        synchronized (thread) {
            thread.interrupt();
        }    
    }
    public TestPy() {
        thread = new Thread(){
            public void run() {
                try {
                    while (!Thread.interrupted()) {
                        Thread.sleep(500);
                    }
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                }
            }
        };
        thread.start();    
    }
    public static void main(String[] args) {
        TestPy tp = new TestPy();
        GatewayServer server = new GatewayServer(tp);
        server.start();
    }
}
Java プログラムを起動し、lib を使用してから、die() メソッドを使用して Python で Java プログラムを強制終了する必要があります。
gateway = JavaGateway()
do your stuff here using the lib
tp = gateway.entry_point
tp.die()