Skip to content

Check if last taken Map element is last

Faced a problem where I need to put elements in two different Maps and after go through all of them and put if condition on the last element of the last Map. Here I have code I’ve tried: Now I have two for loops where I want to check if both for loops have last element right now: I have

How to extract the file jre-9/lib/modules?

In JRE-9/lib directory (at least on Windows), there is a new file called modules whose size is about 107 MB. Is it possible to extract that file or maybe list java modules within it? I can see that a new tool called jmod is available at jdk-9/bin/jmod.exe, but that is for reading .jmod files which is located …

How to prevent reflection access only to certain classes

I am developing some licensing code, so I would like to avoid access to one or two classes through reflection. I have tried implement a SecurityManager but with no success. I found that another option would be to define my own policy file but that requires me to set it on JVM launch, and that defeats my purpo…

JSP can’t display Russian characters

I have a JSP file that contains paragraphs with Russian text. However, no matter what I do I can’t get a browser to display that text – instead all I get is hieroglyphs. The same text but in a simple HTML file without any headers or declarations works fine: But the moment I save that file as JSP a…