Why does Arrays.asList(…).toArray().getClass() give different results in JDK 8 and 9? [duplicate]

The List type returned by asList is Arrays$ArrayList. The toArray method in JDK 8 on that class is: @Override public Object[] toArray() { return a.clone(); } But in JDK 9+ it is: @Override public Object[] toArray() { return Arrays.copyOf(a, a.length, Object[].class); } In both cases a String[] is passed to asList, but in the JDK … Read more

Java Web Start support in Java 9 and beyond

According to http://www.oracle.com/technetwork/java/javase/9-deprecated-features-3745636.html Java Deployment Technologies are deprecated and will be removed in a future release Java Applet and WebStart functionality, including the Applet API, The Java plug-in, the Java Applet Viewer, JNLP and Java Web Start including the javaws tool are all deprecated in JDK 9 and will be removed in a future release. … Read more

Why there is performance degradation after ~6 hours of Java 9 G1 work without the actual increase in load?

(Note that GC tuning is extremely dependant on the environment, so there is no magic recipe.) Had a very similar issue with G1. By default, it seems to be rather badly suited for REST endpoints (again, this is only what I experienced in my direct neighborhood). What helped me was experimenting with the GC flags, … Read more

ClassNotFoundException for javax.xml.bind.JAXBException with Spring Boot when switch to Java 9

You need to add the JAXB dependency (as not provided any longer by default in Java 9) and you have to use Spring Boot 2 : <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> Note that if you use Java 10, you would have exactly the same issue as the JAXB dependency removal was not done just for … Read more

How do I upgrade to jlink (JDK 9+) from Java Web Start (JDK 8) for an auto-updating application?

In May 2019 commented to watch the OpenWebStart project. Now (October 2019) it is time to give OpenWebStart serious consideration. While not yet feature complete, a alpha beta release of OpenWebStart is now available for download under a “GPL with Classpath exception” license. The OpenWebStart Technical Details page states: OpenWebStart is based on Iced-Tea-Web and … Read more

SimpleDateFormat with German Locale – Java 8 vs Java 10+

I don’t say it’s a nice solution, but it seems to be a way through. Map<Long, String> dayOfWeekTexts = Map.of(1L, “Mo”, 2L, “Di”, 3L, “Mi”, 4L, “Do”, 5L, “Fr”, 6L, “Sa”, 7L, “So”); Map<Long, String> monthTexts = Map.ofEntries(Map.entry(1L, “Jan”), Map.entry(2L, “Feb”), Map.entry(3L, “Mär”), Map.entry(4L, “Apr”), Map.entry(5L, “Mai”), Map.entry(6L, “Jun”), Map.entry(7L, “Jul”), Map.entry(8L, “Aug”), Map.entry(9L, “Sep”), … Read more

What is sjavac, who is it for and how do I use it?

What exactly is the sjavac tool? The sjavac tool is an (allegedly smart) wrapper around javac, developed at Oracle and intended to provide the following features: incremental compiles – recompile only what’s necessary parallel compilation – utilize more than one core during compilation keep compiler in a hot VM – reuse a JIT’ed javac instance … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)