Questions tagged [java-17]

JavaSE 17 is the latest java version which is also long term support. Use this tag for issues with JavaSE 17.

Java SE 17 is the latest java version which is also long term support. Use this tag for issues with Java SE 17.

841 questions
-2
votes
1 answer

Create menu using Map but to remove the { } and ", "

I have this menu created : @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") HashMap menu = new HashMap<>(); menu.put(1, "Show clients from banks" + "\n"); menu.put(2, "Create new bank" + "\n"); menu.put(3, """ \t.…
user17695302
-2
votes
1 answer

How does Windows OS decides which JDK compiler to use(oracle JDK /GraalVM jdk), When multiple JDK's are present on 1 system?

I have Oracle JDK 17 installed on my system at the default location in my Windows 10 OS. I can use the javac compiler from the command line. I am going to install GraalVM JDK [java17] in my system (zip file) at a different location. Online docs have…
Rahul.In
  • 61
  • 9
-2
votes
1 answer

How can I make imports less repetitive in Java

Instead of copying and pasting the same import statements in every single class file is there a way to put all of the imports you need on just one file and then call that file for example instead of pasting this every time: import…
Nicholas
  • 13
  • 1
-2
votes
1 answer

Image To Stencil in Java

I am new to image processing in java and I am trying to convert an image to stencil (I think stencil is name given for it!). The input image is this:- After processing the image would be like this:- I searched google. But could find a solution.…
Arsh Coder
  • 688
  • 9
  • 33
-2
votes
1 answer

Default implementation for hashCode() and equals() for record vs class in Java

Tried with sample code to check default behaviour of equals() and hashCode() for record vs class, but it seems behave differently for record compare to class. Here is code sample for record and class public class EqualsAndHashcode { public…
San
  • 66
  • 1
  • 8
-3
votes
2 answers

CoreJava Volume One 11th Edition - Lambda Expression. Couldn't understand author on describing function literal (types)

I am reading CoreJava chapter on Lambda Expression and i couldn't understand the below paragraph. In fact, conversion to a functional interface is the only thing that you can do with a lambda expression in Java. In other programming languages…
yapkm01
  • 3,590
  • 7
  • 37
  • 62
-3
votes
0 answers

Known issues when using JDK 17 with Spring Boot 3.0.4

I am currently working on a project that uses Spring Boot 3.0.4 and we are planning to upgrade our JDK to version 17. Before proceeding with the upgrade, I wanted to gather information about any potential compatibility issues or known problems that…
Mus
  • 21
  • 2
-3
votes
1 answer

JDK 17 Java Security is deprecated

We are using Java security classes in our project and in JDK 17 these are marked for removal. What is the alternative for these classes. We are using the following classes and methods in our project for Script policy security. …
user3436310
  • 65
  • 1
  • 2
  • 6
-3
votes
1 answer

Not able to switch the Java version to Java 17

Posting again since someone moved my question a community where there is not much activity and the solution provided there in the comment did not work. I have installed Amazon Corretto Java 17 from here. However, I am not able to switch the Java…
harsh pamnani
  • 1,191
  • 1
  • 10
  • 14
-3
votes
2 answers

How can I make reflection work on JDK 16 and later?

I have the following legacy code that I migrated to Java 16 but, due to the strong encapsulation introduced by this new version, it doesn't work: try { Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); …
JJB
  • 202
  • 4
  • 11
-4
votes
0 answers

The test cases are failing due to below error after Java upgrade from 11 to 17

public class EnumType extends Enumeration { private int id; private String name; public EnumType(int id, String name){ this.id = id; this.name = name; } public static final EnumType INDIV = new EnumType(1, "string"); public int getID(){return…
SriN
  • 1
  • 1
-4
votes
1 answer

DateTimeFormatter fails to parse a date in JDK 17 where as passes in JDK8

Here is the code snippet String date = "Wed, 20 Feb 2019 07:14:06 +0100"; DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEE, d MMM yyyy HH:mm:ss Z"); System.out.println(ZonedDateTime.parse(date, formatter).toString()); This code works…
Raghu K Nair
  • 3,854
  • 1
  • 28
  • 45
-4
votes
1 answer

Why I'm getting this much worse performance of list.parallelStream() compared to list.stream()?

I'm getting much worse performance when I use list.parallelStream() than when I use list.stream(). Why do you think this is happening? This is Java 17 BTW, and my CPU is i5 of desktop class. import java.text.SimpleDateFormat; import…
-5
votes
1 answer

Upgrade Java version in Java 1.8 project to Java 17

I am planning to upgrade the java version in my project from 1.8 to 17.0.4.1, Hence I wanted to know which all component may break after upgradation. And which version of these component are compatible with Java 17. Anyone who are using java 17 or…
Pawan Verma
  • 129
  • 1
  • 9
-6
votes
1 answer

Differences of components missing from OpenJDK-17 (Eclipse Temurin) which was present in OracleJDK-11

Please help me to know the key differences of components missing from OpenJDK-17 (Eclipse Temurin) which was present in OracleJDK-11.
1 2 3
56
57