Create Java DateTime Instant from microseconds

long timeMicros = 1_565_245_051_795_306L; Instant i = Instant.EPOCH.plus(timeMicros, ChronoUnit.MICROS); System.out.println(i); Output is: 2019-08-08T06:17:31.795306Z Edit: Rather than dividing and multiplying to convert microseconds to milliseconds and/or seconds I preferred to use the built-in support for microseconds. Also when explicitly adding them to the epoch feels a little hand-held. You already know how to convert Instant to … Read more

KeyCloak Server Caused by: java.lang.ClassNotFoundException: java.security.acl.Group

After some research I found the answer to my problem. The problem is that java.security.acl.Group is being deprecated since JRE 9 and marked for removal in future versions. java.security.acl.Group is being replaced by java.security.Policy I was running my Spring-Boot application on JRE 14 in which this class appeared to be no longer available. So once … Read more

Allow insecure HTTPS connection for Java JDK 11 HttpClient

As suggested already you need an SSLContext which ignores the bad certificates. The exact code which obtains the SSLContext in one of the links in the question should work by basically creating a null TrustManager which doesn’t look at the certs: private static TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { … Read more