Looking over the specs of the 5820K versus the 6700K, notable differences are:
Larger cache (15MB vs 8MB)
More cores and threads
Higher memory bandwidth
All of these would probably be of benefit when working, however it has a lower clock speed. That might be the dealbreaker here, as while having lots of threads is great for multitasking (and possibly compiling, not sure if that applies to JDK? Some compilers are still single-threaded) clock speed is also important.
If you intend to overclock the 5820K (quick google search reveals people have got it over 4.0GHz and stable, but runs pretty hot) then I'd say it's safe to go for the 5820K. But if you don't want to do that, the 6700K is might be a better choice given that it is already faster, can be overclocked higher, runs cooler while drawing less power.
So, if you'll benefit more from multithreading take the 5820K
Or, if you need the raw single-core speed take the 6700K
A good comparison of the two from LinusTechTips