Questions tagged [java-12]

Use this tag for questions specific to Java 12, which is version 12 of the Java platform, released on 19 March 2019. In most cases you should also specify the java tag.

This release is the Reference Implementation of version 12 of the Java SE Platform, as specified by JSR 386 in the Java Community Process.

The JDK/12 production-ready binaries are available for Linux and Windows.

Initial JEPs targetted with this are

Java 12 Final Release Specification

115 questions
10
votes
1 answer

Why does an incomplete switch expression compile successfully

Trying out JDK/12 EarlyAccess Build 20, where the JEP-325 Switch Expressions has been integrated as a preview feature. A sample code for the expressions (as in the JEP as well): Scanner scanner = new Scanner(System.in); Day day =…
Naman
  • 27,789
  • 26
  • 218
  • 353
9
votes
1 answer

Does lombok works with Java 12?

I was recently working with Java 11 and Lombok on Intellij and it was all fine. I tried Java 12 but now I'm always getting compilation errors, because lombok 's annotations seem to be ignored. Does anyone know if lombok supports java 12 ? - Intellij…
9
votes
1 answer

Inferred type does not conform to equality constraint error for unrelated variables

I have the following piece of code public class TeeingCollector { public static void main(String[] args) { // var strs = List.of("abc"); var dividedStrings = Stream.of("foo", "hello", "bar", "world") …
Adrian
  • 2,984
  • 15
  • 27
8
votes
3 answers

Package javafx.embed.swing missing from JavaFX 12?

I upgraded from Java 10 to Java 12 and JavaFX 12. Now I can't compile my project anymore because javafx.embed.swingSwingFXUtils is no longer recognized. Intellij can't find any library for the class. Seems like javafx.embed doesn't exist anymore. I…
Guillaume F.
  • 1,010
  • 7
  • 21
8
votes
2 answers

Print chess symbols using UnicodeBlock?

With jdk12, came Chess symbols (source): Unicode 11.0.0 introduced the following new features that are now included in JDK 12 [...] 4 blocks for the following existing scripts: Georgian Extended Mayan Numerals ndic Siyaq Numbers Chess…
Paul Lemarchand
  • 2,068
  • 1
  • 15
  • 27
7
votes
1 answer

Java module system: 'provides with' generic interface

I'm experimenting with the Java module system. I'm trying to use the ServiceLoader for generic interfaces. It works but I've got warnings in the module-info. Here is my minimal code module testProvideWith { provides ServiceGeneric with SString; …
Marco Servetto
  • 684
  • 1
  • 5
  • 14
6
votes
2 answers

After installing JDK, unable to run .jar

During a course it was installed JDK on my computer in order to be able to run eXist database. After this, after executing the command java -jar fileName.jar I get the following error. Graphics Device initialization failed for : d3d, sw Error …
o-sapov
  • 320
  • 2
  • 13
6
votes
2 answers

Java 12 intellij switch expressions doesn't work

I try to use Java 12 in IntelliJ but when I try to run My app occurs error Error:(57, 32) java: switch expressions are a preview feature and are disabled by default. (use --enable-preview to enable switch expressions) I added in app configuration…
6
votes
1 answer

Raw String Literals - Remove Leading Indentation

Edit: Raw String Literals have been dropped from JDK 12, but I'm going to leave this question open and will edit it accordingly whenever Raw String Literals are reintroduced. When testing Raw String Literals (which are a preview feature in Java…
Jacob G.
  • 28,856
  • 5
  • 62
  • 116
5
votes
1 answer

Change static final field in java 12+

This question is strongly related to Change private static final field using Java reflection. There, it was asked, how to change a private static final variable. However, the answers on that question do not work in Java 12+ as you cannot access…
dan1st
  • 12,568
  • 8
  • 34
  • 67
5
votes
1 answer

Apache Axis 1.4 on Java 12

I am currently trying to migrate from a Java 8 project to Java 12. (Hopefully) the last hurdle is an old WebService we are forced to use. Using the WebService 'as is' in Java 8 per se is not a problem, it has been working for many years. The wsdl…
Krann Sock
  • 933
  • 1
  • 7
  • 12
5
votes
1 answer

How to resolve JAXB classpath issues on Java 12

Im porting application using JAXB to JDK 11/12 but am completely lost when trying to fix those JAXB classpath issues. I have googled and read basically everything related to this so Im aware of the changes made in Java11, i.e. removal of JAXB from…
JavaDude
  • 165
  • 2
  • 9
5
votes
1 answer

Is it possible to create spring boot maven project with java 12?

I am trying to create web app using spring boot, maven and java 12. I started the project with spring-boot-starter-parent version 2.1.5.RELEASE, java 12 and maven-compiler-plugin version 3.8.1. I tried to run ./mvnw package but i got this…
Angel
  • 193
  • 1
  • 3
  • 15
5
votes
1 answer

Run Java 12 application in Docker

I took a look at OpenJDK Docker repository and found no JRE image for Java 12. There is one for Java 11 (openjdk:11.0.2-jre), but for 12 there are only JDK images. Q: How to use OpenJDK JRE 12 to run an application in Docker without using a full JDK…
Sasha Shpota
  • 9,436
  • 14
  • 75
  • 148
5
votes
0 answers

Compile to lower java level than allowed by javac using Gradle

I am kicking the tires on Java 12 and noticed that in javac the minimum target java level was increased to 1.7. Execution failed for task ':com.foo:compileJava'. > error: release version 6 not supported Why do I want to compile to Java 6 you…
Andy Guibert
  • 41,446
  • 8
  • 38
  • 61