Category Archives: Java

Java – Guava API to sort items in collection with Ordering compound example

Posted in Java, Programming | Leave a comment

Java – Spring boot with JAX-RS

Enabling Spring boot to use JAX-RS https://dzone.com/articles/using-jax-rs-with-spring-boot-instead-of-mvc http://blog.codeleak.pl/2015/01/getting-started-with-jersey-and-spring.html

Posted in Java, Programming | Leave a comment

Java 9 – useful commands to inspect Module

List modules Diagnostic module dependencies

Posted in Java, Programming | Leave a comment

Java 8 – general practice using Optional

0. Never, ever use null for an Optional variable. 1. Optional should be only used as a return value. : never use it for a field in Class and a method parameter. never use it in collections 2. Never try … Continue reading

Posted in Java, Programming | Tagged | Leave a comment

Java – Task polling example with Java 8

Posted in Java, Programming | Tagged | Leave a comment

Java – Java application monitoring tools

jcmd: Prints basic class, thread, and VM information for a Java process Example) jconsole: Provides a graphical view of JVM activities, including thread usage, class usage, and GC activities jhat: Reads and helps analyze memory heap dumps. This is a … Continue reading

Posted in Java, Programming | Leave a comment

Java – Recommended GC log options for Java 8 and Java 9

Java 8 -XX:+PrintGCDetails -XX:+PrintReferenceGC -XX:+PrintTenuringDistribution -Xloggc: -XX:+PrintGCTimeStamps Java 9 -Xlog:gc* ,gc+ref=debug ,gc+age=trace :file= :tags,uptime Video: https://www.infoq.com/presentations/java-9-gc?utm_source=presentations_about_GarbageCollection&utm_medium=link&utm_campaign=GarbageCollection

Posted in Java, Programming | Leave a comment