[bisq-network/bitcoinj] jdk8 vs jdk 10 (#17)

Oscar Guindzberg notifications at github.com
Tue Dec 18 15:22:20 UTC 2018


About the problem

bisq has to be built using jdk 10. bitcoinj has to be built using jdk 8.

Details
bitcoinj 0.14.4+ uses sun.misc.Cleaner.
sun.* packages should not be used directly as a rule of thumb.
bitcoinj uses them to fix some windows specific issue.
Using sun.* seemed to be the lesser evil (edited) .
The thing is sun.misc.Cleaner was removed in jdk 9.
bitcoinj does not compile if you use jdk 9, 10 or 11.

The problem was discussed on several bitcoinj mailing list msgs and github issues. The most relevant discussion happened here: https://github.com/bitcoinj/bitcoinj/issues/1477

Andreas Schildbach eventually removed the windows specific hack, which eliminates the need to use sun.misc.Cleaner (he thinks the latest versions of windows may not reproduce the bug)
Fix:
https://github.com/bitcoinj/bitcoinj/commit/1700ec0be4fe50a1b7ea95d6af0e46f876746333
Test:
https://github.com/bitcoinj/bitcoinj/commit/dbc4c3520989ecd24b2f81c97cca8903ff15ee7f
Andreas Schildbach did the change on bitcoinj master (not the bitcoinj fork we use)
So, bitcoinj master can be built using jdk 8, 9, 10 or 11.
Nobody confirmed yet that without the hack, bitcoinj does not reproduce the bug on windows.
Even if someones confirm she is running bitcoinj on windows without problems, that does not mean it will run on every windows environment.

The feature that has the windows problem is marked to be refactored in bitcoinj
https://github.com/bitcoinj/bitcoinj/blob/master/core/src/main/java/org/bitcoinj/store/SPVBlockStore.java#L33

How to solve it:

Current solution:
Devs install both jdk8 and jdk10. Tell intellij to use jdk8 for bitcoinj and jdk10 for bisq. Use a bash script to switch jdk versions when the dev needs to run maven/gradle on the command line.

Other possible solutions
- cherry pick https://github.com/bitcoinj/bitcoinj/commit/1700ec0be4fe50a1b7ea95d6af0e46f876746333 to bisq’s bitcoinj fork. That would allow devs to have just jdk10 installed to be able to code and test both bitcoinj and bisq at the risk of bisq users having problems when running on windows.
- Devs cherry pick https://github.com/bitcoinj/bitcoinj/commit/1700ec0be4fe50a1b7ea95d6af0e46f876746333 fix locally. Devs use git stash and other git hacks to avoid pushing that change.
- Invest some time to refactor the bitcoinj feature that has the windows problem and solve the problem for good.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bitcoinj/issues/17
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20181218/acd06652/attachment-0001.html>


More information about the bisq-github mailing list