Skip to content

Tag: java

Returning ZipOutputStream to browser

I have an ZipOutputStream that I want to return to the browser. The experience I would like is that the user clicks an anchor tag, and then a file download prompt is displayed for the ZipOutputStream that I have. How do you get the ZipOutputStream back to the browser? Answer Just had to do this exact same thi…

Windows ignores JAVA_HOME: how to set JDK as default?

How do I persuade Windows to use the JDK instead of a JRE? This question has been asked before, here and elsewhere: How do I set the default Java installation/runtime (Windows)? The trouble is that Windows ignores JAVA_HOME and it also ignores the fact that I made the JDK bin directory the first entry in the …

Why is Lucene sometimes not matching InChIKeys?

I have indexed my database using Hibernate Search. I use a custom analyzer, both for indexing and for querying. I have a field called inchikey that should not get tokenized. Example values are: BBBAWACESCACAP-UHFFFAOYSA-N KEZLDSPIRVZOKZ-AUWJEWJLSA-N When I look into my index with Luke I can confirm that they …

How do I set an empty list of a certain type

We have Collections.EMPTY_LIST but it is not typed, which shows an eclipse warning. How do I set an empty list of a certain type. Answer Try this See this also Type-safe, generic, empty Collections with static generics