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
2
votes
1 answer

Use Class parameter in instanceof method

I have the following method that can return different types of Storable (ex: Food, Ore). Inventory.java public Storable get(Class cls) { for (Storable storable : inventory) { if(cls.isInstance(storable)) { …
Zerak
  • 38
  • 6
2
votes
2 answers

Why is java compiler not complaining about "\s"?

Tried it on openjdk version "15" 2020-09-15 Following simple line String str = "\s"; According to official documentation of list of escape characters, \s is not defined. Spring tool suite does not show compilation error for '\s' nor does when I…
user871199
  • 1,420
  • 19
  • 28
2
votes
1 answer

What does Maven, jaxws:wsimport mean when it says '-Xbootclasspath/p is no longer a supported option'?

I have recently had reason to generate Java classes from a WSDL. I am using Java 15 on Mac, Maven 3.6.3 and JAX-WS 2.3.1. I get the error -Xbootclasspath/p is no longer a supported option. Error: Could not create the Java Virtual Machine. Error: A…
Vihung
  • 12,947
  • 16
  • 64
  • 90
2
votes
1 answer

If my class has many children, how can I initialize an object that is a random child of my class?

For example. Parent: Vehicle Children: Car, Train, Horse I want to do the following Vehicle randVehicle = new RandomeVehicleChildObject; I was thinking I could do this: Vehicle randVehicle; Random r = new Random(); int x = r.nextInt(); if(x ==…
Joao Eanes
  • 21
  • 2
2
votes
1 answer

JAXB on JDK15: which jars are needed?

I work in intelliJIDEA with JDK15 without any Gradle, Maven or else. Yes, we all know that JAXB is removed from JDK since JDK11. So I tried to simply add some libs to the project as jar files: jaxb-runtime-3.0.0 jaxb-impl-3.0.0 …
n00b
  • 55
  • 1
  • 9
2
votes
0 answers

jpackage fails on Mac OS 11.2

I have Mac OS 11.2 and Openjdk 15.0.1. I run jpackage, but when I use option --license-file license.txt the package is build (but without license) and I have an error in the command line: java.io.IOException: Command [/usr/bin/hdiutil, unflatten,…
Hollow.Quincy
  • 547
  • 1
  • 7
  • 14
2
votes
3 answers

Nashorn compatibility with Java 1.8 to 15?

I need my software which uses the Nashorn JavaScript engine to be compatible with Java 1.8 upwards. If I use the one bundled with the JDK it will not work on Java >= 15. If I use the standalone Nashorn it will not be compatible with Java < 15. Is…
iamgio
  • 83
  • 9
2
votes
2 answers

Reentrant lock implementation detail

I am trying to understand a particular detail in ReentrantLock::lock method. I am looking at it and seeing it as: final void lock() { if (!initialTryLock()) { acquire(1); } } So first it tries this method : initialTryLock (I will look…
Eugene
  • 117,005
  • 15
  • 201
  • 306
2
votes
1 answer

What is the Text Blocks (or Multiline Strings) feature in Java?

Java SE 13 introduced Text Blocks (or Multiline Strings) feature. What are its differences and the similarities with the existing string representation?
Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110
2
votes
2 answers

Sealed classes don't compile, Eclipse compiler bug?

I am having those two classes in Eclipse 2020-09 and 2020-12: Class A package test; public sealed class A permits B { } Class B package test; import java.io.Serializable; public final class B extends A implements Serializable { } However, the…
Dorian Gray
  • 2,913
  • 1
  • 9
  • 25
2
votes
0 answers

How to create an InitialDirContext in an OSGi component inside felix (v603) running on top of jdk15

I am in the process of upgrading my jdk8 code to jdk15 and have most of the dependencies and config settings working but I am struggling with the creation of a new InitialDirContext. My component is sending out a mail and is setting up…
2
votes
0 answers

Using cannonical constructor of local record (preview-feature) in Eclipse causes verify error

I am Trying to use records preview-feature with cannonical constructors in Eclipse . public class Example { public static void main(String[] args) { record Range() { Range { } } new Range(); …
Gonen I
  • 5,576
  • 1
  • 29
  • 60
2
votes
0 answers

Error occurred during initialization of boot layer java.lang.module.FindException: Module jdk.management.agent not found

I am setting up my first Spring Boot application using Eclipse > New > Spring-Starter project The project files are appearing and compiling. I am even able to RunAs > Java project with console output. On choosing RunAs > Spring Boot, I am getting…
2
votes
2 answers

SoapUI 5.6.0 UnsupportedClassVersionError on Windows 8.1

I have installed following version of Java on Windows 8.1. JAVA_HOME environment variable points to newly installed JDK library. java 15 2020-09-15 Java(TM) SE Runtime Environment (build 15+36-1562) Java HotSpot(TM) 64-Bit Server VM (build…
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
2
votes
2 answers

How to regenerate private key using EdDSA/Ed448 signature algorithm?

Here is how I generated the key pair: var keyPairGenerator = KeyPairGenerator.getInstance("Ed448"); keyPairGenerator.initialize(448, SecureRandom.getInstanceStrong()); var keyPair = keyPairGenerator.generateKeyPair(); var privateKey =…
Eng.Fouad
  • 115,165
  • 71
  • 313
  • 417