Skip to content

Tag: java-8

installing tomcat 9 on WSL

After installing tomcat 9 on WSL, it isn’t recognized by system. Since systemctl command doesn’t work on WSL, I used below command: returning I followed 2 ways to install, but the same problem occurred. References are: https://www.digitalocean.com/community/tutorials/install-tomcat-9-ubuntu-1804 h…

Exception propagation in CompletableFuture (java)

How can I propagate exception encountered in the following code inside CompletableFuture.runAsync to my main thread? I want to catch the IllegalStateException in my main thread. Answer One option would be to create a Collection of Throwable objects and when the CompletableFuture completes you can add the exce…

Possible to remove Title bar from JFileChooser?

I am trying to display a simple JFileChooser that has no Titlebar. Below is the example code: So essentially I want the Border I set to be the top level Title bar. Example image: So far I have had zero luck achieving this, nor found any others looking for a similar appearance. Appreciate the help! Cheers Answ…

Java 8 Remove 1 List from Other

I have two list of different Objects. I want to remove the list of School objects from List of World objects based on schoolName and location. I cannot use equals and hashCode methods on those two fields as it is creating some other problem. Please help me how it can be done using streams. Answer You can use …