As part of our plans to integrate blockchain technology, I am looking at Ethereum and playing around with the java API (web3j). One obviously starts with the examples but I found that the VM does not actually stop after all example code has completed. The example code seems to be cleaning up all the resources it acquires but since the VM is not actually stopping, I am assuming it is leaving some thread running and the VM is waiting on that thread to complete.
I have added the following at the end of the Main#run() method:
System.out.println("Main done, expect the VM to quit anytime now");
and that prints out fine so the code completes. I have also added a shutdown hook but that never gets invoked.
I was wondering if anybody else is experiencing the same thing and how they have solved it or if there is perhaps a more fundamental flaw in the Web3J library that does not cleanup acquired resources?