Questions tagged [java-15]

Use this tag for questions specific to Java 15, which is version 15 of the Java platform, released on September 15, 2020. In most cases you should also specify the java tag.

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

111 questions
7
votes
1 answer

JDK 15 Sealed Classes - how to use across packages?

I have a simple sealed class, MyShape: public sealed class MyShape permits MyCircle { private final int width; private final int height; public MyShape(int width, int height) { this.width = width; this.height = height; …
Luke
  • 2,151
  • 3
  • 17
  • 15
6
votes
1 answer

Proper way to wait for List> to indicate all operations have finished

I am running several hundred functions with runAsync(). All of the functions modify some statically available list and thus do not need to return anything. I want to make sure they all finish before continuing my processing. Is this the appropriate…
TheFunk
  • 981
  • 11
  • 39
6
votes
3 answers

Ed25519 in JDK 15, Parse public key from byte array and verify

Since Ed25519 has not been around for long (in JDK), there are very few resources on how to use it. While their example is very neat and useful, I have some trouble understanding what am I doing wrong regarding key parsing. They Public Key is being…
Programmer
  • 134
  • 1
  • 12
6
votes
1 answer

Java Text Blocks: Mix of Tabs and Spaces within Indentation Prefixes

Java 15 introduced (non-preview) text blocks feature. It allows to define multi-lined string literals without breaking code indentation, by stripping the common white space prefix from the lines. The algorithm is described in JEP 378. But how…
Alex Shesterov
  • 26,085
  • 12
  • 82
  • 103
6
votes
1 answer

Does Apache NetBeans 12.1 support JDK 15?

Oracle recently released JDK 15, and I'm wondering if Apache NetBeans 12.1, the latest version of the NetBeans IDE, supports JDK 15. I understand that NetBeans doesn't officially support JDK 15, but I'm asking if anyone knows that it unofficially…
Tech Expert Wizard
  • 365
  • 1
  • 6
  • 21
6
votes
1 answer

UseCompressedOops UseCompressedClassPointers in jdk-13 and jdk-15

Accidentally I have stumbled into a change in Java 15 that I was not aware of. Suppose I have a very simple question: what is the size of an array of 3 integers? For this, I use JOL. The code is fairly trivial: import…
Eugene
  • 117,005
  • 15
  • 201
  • 306
5
votes
1 answer

Difference between sealed and final class in Java

I have just read that Java 15 should have sealed classes. jep360 says: Sealed classes and interfaces restrict which other classes or interfaces may extend or implement them. I thought that this is exactly what a final class does in Java. So now I…
anion
  • 1,516
  • 1
  • 21
  • 35
5
votes
2 answers

jOOQ with java 15: both interface org.jooq.Record in org.jooq and class java.lang.Record in java.lang match

I've just tried upgrading my project to Java 15, and now I get the following error: both interface org.jooq.Record in org.jooq and class java.lang.Record in java.lang match Does anybody have some experience resolving this issue?
Ynv
  • 1,824
  • 3
  • 20
  • 29
4
votes
4 answers

How to set Java version for SBT

I am trying to run a scala program, in which there are errors with Java 16. My colleague is using Java 15, and all is fine. When i type java -version in my terminal it says i am using Java 15. However, when i run sbt run -v, it says it is using Java…
LondonMassive
  • 367
  • 2
  • 5
  • 20
4
votes
0 answers

Sealing interface with generics in eclipse

The following is legal (i.e. I can compile it) and works in Java 15 with preview features enabled (in eclipse 2020-09) public sealed interface Quantity permits QuantityImpl { } public record QuantityImpl(T value) implements…
John
  • 251
  • 3
  • 5
3
votes
3 answers

Different Nashorn engine for Java < 15 and >= 15?

I'm trying to find a workaround for Nashorn to be compatible with every version of Java from 1.8 upwards as said in another question I asked earlier. I'm currently trying to catch UnsupportedClassVersionError in order to find out if the system is…
iamgio
  • 83
  • 9
3
votes
2 answers

NetBeans 12.0: "Class does not have a main method" (but it does)

NetBeans 12.0 Jdk 15 I cannot launch my program, clicking the green run button doesn't do anything, and right click + run file on MainFrame gives the error "Class does not have a main method". But as you can see in the GIF below, it does have a…
SJ19
  • 1,933
  • 6
  • 35
  • 68
3
votes
1 answer

Is it possible to refine sealed classes with "sealed methods"?

I am playing with the preview sealed classes in java 15, and I was wondering why the keywords sealed and non-sealed only apply to classes and interfaces, but not methods (like other modifiers do). I imagine it might be useful to decide specifically,…
jf_
  • 3,099
  • 2
  • 13
  • 31
3
votes
2 answers

Java generics impossible assignment?

Every time I think I understand generics better (and can answer without compiling), I get to an example where this theory breaks. Here is a very simple example: static void consumer(List> param) { …
Eugene
  • 117,005
  • 15
  • 201
  • 306
2
votes
1 answer

How to Access JavaFX Virtual Keyboard (FXVK) Using Open JDK 15 or beyond?

I use the javafx virtual keyboard with open jdk 8. At times I have to access the virtual keyboard to prevent it from displaying when certain text fields get focus. An example of this is a screen where an operator has to scan in multiple barcodes.…